-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBottomNavigationBar.kt
More file actions
34 lines (32 loc) · 1.16 KB
/
BottomNavigationBar.kt
File metadata and controls
34 lines (32 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.yapp.ndgl.ui
import androidx.compose.material3.Icon
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.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import com.yapp.ndgl.navigation.BottomNavTab
import com.yapp.ndgl.navigation.Route
@Composable
internal fun BottomNavigationBar(
currentTab: Route,
onTabSelected: (Route) -> Unit,
) {
// FIXME 네비게이션 바 디자인 수정 및 추상화
NavigationBar {
BottomNavTab.entries.forEach { topLevelRoute ->
NavigationBarItem(
selected = currentTab == topLevelRoute.route,
onClick = { onTabSelected(topLevelRoute.route) },
icon = {
Icon(
imageVector = ImageVector.vectorResource(id = topLevelRoute.icon),
contentDescription = topLevelRoute.label,
)
},
label = { Text(text = topLevelRoute.label) },
)
}
}
}