Skip to content

Commit

Permalink
Merge pull request #18 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
Corrections for welcome Screen
  • Loading branch information
stzouvaras authored Feb 8, 2024
2 parents 4631a9a + 2acf457 commit 9c2d2b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import eu.europa.ec.resourceslogic.R
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.resourceslogic.theme.values.bottomCorneredShapeSmall
import eu.europa.ec.uilogic.component.AppIcons
import eu.europa.ec.uilogic.component.preview.PreviewTheme
Expand Down Expand Up @@ -105,7 +106,7 @@ private fun Content(
.fillMaxWidth()
.fillMaxHeight(animatedWeight)
.background(
color = MaterialTheme.colorScheme.primary,
color = MaterialTheme.colorScheme.backgroundPaper,
shape = MaterialTheme.shapes.bottomCorneredShapeSmall
),
contentAlignment = Alignment.Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

package eu.europa.ec.loginfeature.ui.welcome

import eu.europa.ec.commonfeature.model.PinFlow
import eu.europa.ec.uilogic.mvi.MviViewModel
import eu.europa.ec.uilogic.mvi.ViewEvent
import eu.europa.ec.uilogic.mvi.ViewSideEffect
import eu.europa.ec.uilogic.mvi.ViewState
import eu.europa.ec.uilogic.navigation.DashboardScreens
import eu.europa.ec.uilogic.navigation.CommonScreens
import eu.europa.ec.uilogic.navigation.LoginScreens
import eu.europa.ec.uilogic.navigation.Screen
import eu.europa.ec.uilogic.navigation.helper.generateComposableArguments
import eu.europa.ec.uilogic.navigation.helper.generateComposableNavigationLink
import org.koin.android.annotation.KoinViewModel

data class State(
Expand Down Expand Up @@ -50,15 +52,21 @@ class WelcomeScreenViewModel : MviViewModel<Event, State, Effect>() {

override fun handleEvents(event: Event) {
when (event) {
is Event.NavigateToLogin -> navigateTo(DashboardScreens.Dashboard, true)
is Event.NavigateToFaq -> navigateTo(LoginScreens.Faq, false)
is Event.NavigateToLogin -> navigateTo(
route = generateComposableNavigationLink(
screen = CommonScreens.QuickPin,
arguments = generateComposableArguments(mapOf("pinFlow" to PinFlow.CREATE))
)
)

is Event.NavigateToFaq -> navigateTo(LoginScreens.Faq.screenRoute)
}
}

private fun navigateTo(screen: Screen, currentInclusive: Boolean) {
private fun navigateTo(route: String, currentInclusive: Boolean = false) {
setEffect {
Effect.Navigation.SwitchScreen(
screenRoute = screen.screenRoute,
screenRoute = route,
currentInclusive = currentInclusive
)
}
Expand Down

0 comments on commit 9c2d2b7

Please sign in to comment.