Skip to content

Commit 61891bd

Browse files
committed
Refactor navigation logic and formatting in TopNavBar.
- Update navigation calls to use type-safe `popUpTo<HomeRoute>` instead of the route object. - Adjust `popUpTo` configuration by setting `inclusive = false` and removing `saveState` and `restoreState` flags. - Reformat the `variant` property assignment in the navigation link `Button` for better readability.
1 parent b95a4a0 commit 61891bd

File tree

1 file changed

+7
-9
lines changed
  • composeApp/src/webMain/kotlin/zed/rainxch/rikkaui/components

1 file changed

+7
-9
lines changed

composeApp/src/webMain/kotlin/zed/rainxch/rikkaui/components/TopNavBar.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,17 @@ fun TopNavBar(
7878
text = link.label,
7979
onClick = {
8080
navController.navigate(link.route) {
81-
popUpTo(HomeRoute) {
82-
saveState = true
81+
popUpTo<HomeRoute> {
82+
inclusive = false
8383
}
8484
launchSingleTop = true
85-
restoreState = true
8685
}
8786
},
88-
variant =
89-
if (isActive) {
90-
ButtonVariant.Secondary
91-
} else {
92-
ButtonVariant.Ghost
93-
},
87+
variant = if (isActive) {
88+
ButtonVariant.Secondary
89+
} else {
90+
ButtonVariant.Ghost
91+
},
9492
size = ButtonSize.Sm,
9593
)
9694
}

0 commit comments

Comments
 (0)