openAndPopUp needs to be passed down to navbar and drawer
This commit is contained in:
parent
a5df9cf191
commit
373d7281fe
1 changed files with 15 additions and 17 deletions
|
@ -6,17 +6,17 @@ import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Menu
|
import androidx.compose.material.icons.filled.Menu
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import be.ugent.sel.studeez.R
|
import be.ugent.sel.studeez.R
|
||||||
import be.ugent.sel.studeez.resources
|
import be.ugent.sel.studeez.resources
|
||||||
import be.ugent.sel.studeez.ui.theme.StudeezTheme
|
import be.ugent.sel.studeez.screens.drawer.Drawer
|
||||||
|
import be.ugent.sel.studeez.screens.navbar.NavigationBar
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PrimaryScreenTemplate(
|
fun PrimaryScreenTemplate(
|
||||||
title: String,
|
title: String,
|
||||||
onLogoutClick: () -> Unit,
|
openAndPopUp: (String, String) -> Unit,
|
||||||
content: @Composable (PaddingValues) -> Unit
|
content: @Composable (PaddingValues) -> Unit
|
||||||
) {
|
) {
|
||||||
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
val scaffoldState: ScaffoldState = rememberScaffoldState()
|
||||||
|
@ -40,12 +40,10 @@ fun PrimaryScreenTemplate(
|
||||||
) },
|
) },
|
||||||
|
|
||||||
drawerContent = {
|
drawerContent = {
|
||||||
Drawer(
|
Drawer(openAndPopUp)
|
||||||
onLogoutClick = { onLogoutClick() }
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
bottomBar = { NavigationBar() }, // TODO Pass arguments so that the current tab etc can be shown
|
bottomBar = { NavigationBar(openAndPopUp) },
|
||||||
floatingActionButtonPosition = FabPosition.Center,
|
floatingActionButtonPosition = FabPosition.Center,
|
||||||
isFloatingActionButtonDocked = true,
|
isFloatingActionButtonDocked = true,
|
||||||
floatingActionButton = { CollapsedAddButton() }
|
floatingActionButton = { CollapsedAddButton() }
|
||||||
|
@ -54,13 +52,13 @@ fun PrimaryScreenTemplate(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Preview
|
//@Preview
|
||||||
@Composable
|
//@Composable
|
||||||
fun PrimaryScreenPreview() {
|
//fun PrimaryScreenPreview() {
|
||||||
StudeezTheme {
|
// StudeezTheme {
|
||||||
PrimaryScreenTemplate(
|
// PrimaryScreenTemplate(
|
||||||
"Preview screen",
|
// "Preview screen",
|
||||||
{}
|
// {}
|
||||||
) {}
|
// ) {}
|
||||||
}
|
// }
|
||||||
}
|
//}
|
Reference in a new issue