compose: onboarding: Rename child screens to pages
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -80,8 +80,8 @@ private fun ScreenContent(
|
||||
verticalAlignment = Alignment.Top
|
||||
) { page ->
|
||||
when (pages[page]) {
|
||||
ExtraScreen.Welcome -> WelcomeScreen()
|
||||
ExtraScreen.Permissions -> PermissionsScreen()
|
||||
ExtraScreen.Welcome -> WelcomePage()
|
||||
ExtraScreen.Permissions -> PermissionsPage()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ import com.aurora.store.viewmodel.commons.PermissionRationaleViewModel
|
||||
import kotlin.random.Random
|
||||
|
||||
@Composable
|
||||
fun PermissionsScreen(viewModel: PermissionRationaleViewModel = hiltViewModel()) {
|
||||
fun PermissionsPage(viewModel: PermissionRationaleViewModel = hiltViewModel()) {
|
||||
val permissions by viewModel.permissions.collectAsStateWithLifecycle()
|
||||
|
||||
ScreenContent(
|
||||
PageContent(
|
||||
permissions = permissions,
|
||||
onPermissionCallback = { viewModel.refreshPermissionsList() }
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ScreenContent(
|
||||
private fun PageContent(
|
||||
permissions: List<Permission> = emptyList(),
|
||||
onPermissionCallback: (type: PermissionType) -> Unit = {}
|
||||
) {
|
||||
@@ -73,7 +73,7 @@ private fun ScreenContent(
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun PermissionsScreenPreview() {
|
||||
private fun PermissionsPagePreview() {
|
||||
val permissions = PermissionType.entries.map { type ->
|
||||
Permission(
|
||||
type = type,
|
||||
@@ -84,7 +84,7 @@ private fun PermissionsScreenPreview() {
|
||||
)
|
||||
}
|
||||
PreviewTemplate {
|
||||
ScreenContent(
|
||||
PageContent(
|
||||
permissions = permissions
|
||||
)
|
||||
}
|
||||
@@ -35,18 +35,18 @@ import com.aurora.store.compose.ui.about.AboutDialog
|
||||
import com.aurora.store.data.model.Link
|
||||
|
||||
@Composable
|
||||
fun WelcomeScreen() {
|
||||
fun WelcomePage() {
|
||||
var shouldShowAboutDialog by rememberSaveable { mutableStateOf(false) }
|
||||
|
||||
if (shouldShowAboutDialog) {
|
||||
AboutDialog(onDismiss = { shouldShowAboutDialog = false })
|
||||
}
|
||||
|
||||
ScreenContent(onAboutAurora = { shouldShowAboutDialog = true })
|
||||
PageContent(onAboutAurora = { shouldShowAboutDialog = true })
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ScreenContent(onAboutAurora: () -> Unit = {}) {
|
||||
private fun PageContent(onAboutAurora: () -> Unit = {}) {
|
||||
val context = LocalContext.current
|
||||
|
||||
val links = listOf(
|
||||
@@ -137,8 +137,8 @@ private fun ScreenContent(onAboutAurora: () -> Unit = {}) {
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun WelcomeScreenPreview() {
|
||||
private fun WelcomePagePreview() {
|
||||
PreviewTemplate {
|
||||
ScreenContent()
|
||||
PageContent()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user