Skip to content

Commit

Permalink
Merge pull request #213 from Infomaniak/add-rail-label
Browse files Browse the repository at this point in the history
feat: Improve NavigationRail by adding label
  • Loading branch information
FabianDevel authored Nov 27, 2024
2 parents 14cdf38 + b9e07a8 commit 5e7b337
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ private fun AppNavigationRail(
containerColor = SwissTransferTheme.colors.navigationItemBackground,
windowInsets = WindowInsets(left = 0, top = 0, right = 0, bottom = 0),
) {
navigationItems.forEach { navigationItem ->
navigationItems.forEachIndexed { index, navigationItem ->
NavigationRailItem(
icon = { NavigationIcon(false, navigationItem) },
label = {}, // Don't remove this seemingly useless label, it changes the icons background.
label = { NavigationLabel(navigationItem) },
selected = currentDestination == navigationItem.destination,
onClick = { onClick(navigationItem.destination) },
)
if (index != navigationItems.lastIndex) {
Spacer(modifier = Modifier.height(Margin.Micro))
}
}
}
}
Expand Down

0 comments on commit 5e7b337

Please sign in to comment.