Change icon type

This commit is contained in:
Shcherbatykh Oleg
2026-02-27 11:21:03 +03:00
parent 993ab0a0b1
commit aaed01bd12
6 changed files with 41 additions and 49 deletions

View File

@@ -0,0 +1,9 @@
package ru.fincode.core.ui.components
import androidx.compose.ui.graphics.vector.ImageVector
data class BottomBarItem(
val key: String,
val label: String,
val icon: ImageVector,
)

View File

@@ -1,17 +1,11 @@
package ru.fincode.core.ui.components
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.painter.Painter
data class BottomBarItem(
val key: String,
val label: String,
val icon: Painter,
)
@Composable
fun TsudeskBottomBar(
@@ -21,19 +15,22 @@ fun TsudeskBottomBar(
) {
NavigationBar {
items.forEach { item ->
val selected = item.key == selectedKey
NavigationBarItem(
selected = item.key == selectedKey,
selected = selected,
onClick = { onItemClick(item) },
icon = {
Icon(
painter = item.icon,
contentDescription = item.label
imageVector = item.icon,
contentDescription = item.label,
tint = if (selected)
MaterialTheme.colorScheme.primary
else
MaterialTheme.colorScheme.onSurfaceVariant
)
},
label = {
Text(text = item.label)
},
alwaysShowLabel = true
label = { Text(item.label) }
)
}
}