From 86e6be8146df9004636474aa49b37eea927a71e1 Mon Sep 17 00:00:00 2001 From: shahondin1624 Date: Fri, 13 Mar 2026 13:20:11 +0100 Subject: [PATCH] feat: top app bar title updates based on current route (Closes #22) (#52) --- sharedUI/src/commonMain/kotlin/org/shahondin1624/App.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sharedUI/src/commonMain/kotlin/org/shahondin1624/App.kt b/sharedUI/src/commonMain/kotlin/org/shahondin1624/App.kt index 68e98c1..8ea3be1 100644 --- a/sharedUI/src/commonMain/kotlin/org/shahondin1624/App.kt +++ b/sharedUI/src/commonMain/kotlin/org/shahondin1624/App.kt @@ -240,12 +240,19 @@ private fun MainScaffold( modifier: Modifier = Modifier ) { var isDark by LocalThemeIsDark.current + val currentRoute = currentRoute(navController) + + val topBarTitle = when (currentRoute) { + AppRoutes.CHARACTER_SHEET -> EXAMPLE_CHARACTER.characterData.name + AppRoutes.SETTINGS -> "Settings" + else -> "Shadowrun Character Sheet" + } Scaffold( modifier = modifier.fillMaxSize(), topBar = { TopAppBar( - title = { Text("Shadowrun Character Sheet") }, + title = { Text(topBarTitle) }, modifier = Modifier.testTag(TestTags.TOP_APP_BAR), navigationIcon = { if (showMenuButton) {