Rename action to barAction

This commit is contained in:
Tibo De Peuter 2023-04-26 10:33:35 +02:00
parent ce3261df07
commit d268fcd389
3 changed files with 8 additions and 7 deletions

View file

@ -20,7 +20,7 @@ import be.ugent.sel.studeez.R.string as AppText
fun DrawerScreenTemplate(
title: String,
drawerActions: DrawerActions,
action: @Composable RowScope.() -> Unit = {},
barAction: @Composable RowScope.() -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
val scaffoldState: ScaffoldState = rememberScaffoldState()
@ -41,7 +41,7 @@ fun DrawerScreenTemplate(
)
}
},
actions = action
actions = barAction
)},
drawerContent = {

View file

@ -31,7 +31,7 @@ fun PrimaryScreenTemplate(
title: String,
drawerActions: DrawerActions,
navigationBarActions: NavigationBarActions,
action: @Composable RowScope.() -> Unit = {},
barAction: @Composable RowScope.() -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
val scaffoldState: ScaffoldState = rememberScaffoldState()
@ -53,7 +53,7 @@ fun PrimaryScreenTemplate(
)
}
},
actions = action
actions = barAction
)
},

View file

@ -1,6 +1,7 @@
package be.ugent.sel.studeez.common.composable
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.RowScope
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
@ -10,13 +11,12 @@ import be.ugent.sel.studeez.R
import be.ugent.sel.studeez.resources
import be.ugent.sel.studeez.ui.theme.StudeezTheme
// TODO Add option for button in top right corner as extra button
@Composable
// Does not contain floatingActionButton and bottom bar, used in all the other screens
fun SecondaryScreenTemplate(
title: String,
popUp: () -> Unit,
barAction: @Composable RowScope.() -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
Scaffold(
@ -30,7 +30,8 @@ fun SecondaryScreenTemplate(
contentDescription = resources().getString(R.string.go_back)
)
}
}
},
actions = barAction
) },
) { paddingValues ->
content(paddingValues)