Impl base structure of bottom-navigation
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
package ru.fincode.tsudesk.feature.schedule.presentation.screen
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
|
||||
@Composable
|
||||
fun ScheduleRoute(
|
||||
viewModel: ScheduleViewModel = hiltViewModel()
|
||||
modifier: Modifier = Modifier,
|
||||
// onOpenDetails: (lessonId: Long) -> Unit,
|
||||
viewModel: ScheduleViewModel = hiltViewModel(),
|
||||
) {
|
||||
val state = viewModel.state.collectAsStateWithLifecycle().value
|
||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
||||
|
||||
ScheduleScreen(
|
||||
state = state,
|
||||
onIntent = viewModel::onIntent
|
||||
onIntent = viewModel::onIntent,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
@@ -12,12 +12,14 @@ fun SplashRoute(
|
||||
viewModel: SplashViewModel = hiltViewModel()
|
||||
) {
|
||||
val state = viewModel.state.collectAsStateWithLifecycle().value
|
||||
LaunchedEffect(Unit) {
|
||||
|
||||
LaunchedEffect(viewModel) {
|
||||
viewModel.effects.collect { effect ->
|
||||
when (effect) {
|
||||
SplashEffect.OpenMain -> onFinish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SplashScreen(state = state)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user