Skip to content

Commit

Permalink
Merge pull request #67 from Infomaniak/fix-top-app-bar
Browse files Browse the repository at this point in the history
Fix top app bar
  • Loading branch information
LunarX authored Sep 20, 2024
2 parents 79962b4 + 45f7381 commit a6843ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun SwissTransferTobAppBar(
actionIconContentColor = SwissTransferTheme.colors.toolbarIconColor,
navigationIconContentColor = SwissTransferTheme.colors.toolbarIconColor,
),
title = { Text(stringResource(id = titleRes)) },
title = { Text(stringResource(id = titleRes), style = SwissTransferTheme.typography.h2) },
navigationIcon = { navigationMenu?.let { MenuButton(navigationMenu) } },
actions = { actionMenus.forEach { actionMenu -> MenuButton(actionMenu) } },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Scaffold
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
Expand All @@ -31,6 +32,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import com.infomaniak.swisstransfer.ui.components.SwissTransferTobAppBar
import com.infomaniak.swisstransfer.ui.components.TopAppBarButton
import com.infomaniak.swisstransfer.ui.screen.main.LocalNavType

@Composable
fun OptionScaffold(
Expand All @@ -42,8 +44,12 @@ fun OptionScaffold(
navigateBack: (() -> Unit)? = null,
) {
Scaffold(topBar = {
val canDisplayBackButton = navigateBack?.let { TopAppBarButton.backButton(navigateBack) }
SwissTransferTobAppBar(topAppBarTitleRes, navigationMenu = canDisplayBackButton)
val backNavigationMenu = if (LocalNavType.current == NavigationSuiteType.NavigationBar) {
TopAppBarButton.backButton(navigateBack ?: {})
} else {
null
}
SwissTransferTobAppBar(topAppBarTitleRes, navigationMenu = backNavigationMenu)
}) { paddingsValue ->
Column(
modifier = Modifier
Expand Down

0 comments on commit a6843ed

Please sign in to comment.