Skip to content

Commit

Permalink
Fix disappearing back arrow in phone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Sep 19, 2024
1 parent 7cc4b91 commit 9a8bcf4
Showing 1 changed file with 7 additions and 1 deletion.
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,7 +44,11 @@ fun OptionScaffold(
navigateBack: (() -> Unit)? = null,
) {
Scaffold(topBar = {
val canDisplayBackButton = navigateBack?.let { TopAppBarButton.backButton(navigateBack) }
val canDisplayBackButton = if (LocalNavType.current == NavigationSuiteType.NavigationBar) {
TopAppBarButton.backButton(navigateBack ?: {})
} else {
null
}
SwissTransferTobAppBar(topAppBarTitleRes, navigationMenu = canDisplayBackButton)
}) { paddingsValue ->
Column(
Expand Down

0 comments on commit 9a8bcf4

Please sign in to comment.