Using now Scaffold.drawerContent instead of SideMenu
This commit is contained in:
parent
1bb23c816f
commit
2315e4b84a
|
@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.codinux.banking.ui.appskeleton.BottomBar
|
import net.codinux.banking.ui.appskeleton.BottomBar
|
||||||
import net.codinux.banking.ui.appskeleton.SideMenu
|
import net.codinux.banking.ui.appskeleton.SideMenuContent
|
||||||
import net.codinux.banking.ui.composables.StateHandler
|
import net.codinux.banking.ui.composables.StateHandler
|
||||||
import net.codinux.banking.ui.composables.transactions.TransactionsList
|
import net.codinux.banking.ui.composables.transactions.TransactionsList
|
||||||
import net.codinux.banking.ui.config.Colors
|
import net.codinux.banking.ui.config.Colors
|
||||||
|
@ -44,6 +44,8 @@ fun App() {
|
||||||
|
|
||||||
val uiSettings = DI.uiSettings
|
val uiSettings = DI.uiSettings
|
||||||
|
|
||||||
|
val drawerState = DI.uiState.drawerState.collectAsState().value
|
||||||
|
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
|
@ -52,8 +54,8 @@ fun App() {
|
||||||
|
|
||||||
|
|
||||||
MaterialTheme(colors = colors, typography = typography) {
|
MaterialTheme(colors = colors, typography = typography) {
|
||||||
SideMenu {
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
scaffoldState = rememberScaffoldState(drawerState),
|
||||||
bottomBar = { BottomBar() },
|
bottomBar = { BottomBar() },
|
||||||
backgroundColor = Colors.Zinc100,
|
backgroundColor = Colors.Zinc100,
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
|
@ -65,6 +67,8 @@ fun App() {
|
||||||
Icon(Icons.Filled.Add, contentDescription = "Add a bank account")
|
Icon(Icons.Filled.Add, contentDescription = "Add a bank account")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
drawerContent = { SideMenuContent() },
|
||||||
|
drawerBackgroundColor = Colors.DrawerContentBackground,
|
||||||
snackbarHost = { snackbarHostState ->
|
snackbarHost = { snackbarHostState ->
|
||||||
StateHandler(uiState, snackbarHostState)
|
StateHandler(uiState, snackbarHostState)
|
||||||
|
|
||||||
|
@ -92,4 +96,3 @@ fun App() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package net.codinux.banking.ui.appskeleton
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
|
||||||
import androidx.compose.material.ModalDrawer
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.collectAsState
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import net.codinux.banking.ui.config.Colors
|
|
||||||
import net.codinux.banking.ui.config.DI
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun SideMenu(appContent: @Composable () -> Unit) {
|
|
||||||
val drawerState = DI.uiState.drawerState.collectAsState().value
|
|
||||||
|
|
||||||
ModalDrawer(
|
|
||||||
modifier = Modifier.fillMaxHeight(),
|
|
||||||
drawerState = drawerState,
|
|
||||||
content = appContent,
|
|
||||||
drawerBackgroundColor = Colors.DrawerContentBackground,
|
|
||||||
drawerContent = { SideMenuContent() }
|
|
||||||
)
|
|
||||||
}
|
|
Loading…
Reference in New Issue