Skip to content

Commit 753661a

Browse files
authored
Merge pull request #629 from code-payments/feat/nav3
Feat/nav3
2 parents 6f3cb6b + 4351e24 commit 753661a

128 files changed

Lines changed: 4833 additions & 4176 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/flipcash/app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ dependencies {
200200
implementation(project(":libs:quickresponse"))
201201
implementation(project(":ui:biometrics"))
202202
implementation(project(":ui:components"))
203+
implementation(project(":ui:navigation"))
203204
implementation(project(":ui:scanner"))
204205
implementation(project(":ui:resources"))
205206
implementation(project(":ui:theme"))

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui/App.kt

Lines changed: 159 additions & 193 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
package com.flipcash.app.internal.ui.navigation
22

3-
import android.os.Parcelable
43
import androidx.compose.runtime.Composable
54
import androidx.compose.runtime.rememberCoroutineScope
6-
import cafe.adriel.voyager.core.registry.ScreenRegistry
7-
import cafe.adriel.voyager.core.screen.Screen
85
import com.flipcash.app.core.AppRoute
96
import com.flipcash.app.internal.ui.HomeViewModel
10-
import com.getcode.navigation.core.LocalCodeNavigator
117
import com.getcode.navigation.extensions.getActivityScopedViewModel
12-
import com.getcode.navigation.screens.AppScreen
8+
import com.getcode.navigation.core.LocalCodeNavigator
139
import com.getcode.ui.components.restrictions.ContentRestrictedView
1410
import com.getcode.ui.core.RestrictionType
1511
import kotlinx.coroutines.launch
16-
import kotlinx.parcelize.IgnoredOnParcel
17-
import kotlinx.parcelize.Parcelize
18-
19-
@Parcelize
20-
class AppRestrictedScreen(private val restrictionType: RestrictionType): AppScreen, Parcelable {
21-
22-
@IgnoredOnParcel
23-
override val testTag: String = "app_restricted_screen"
2412

25-
@Composable
26-
override fun ScreenContent() {
27-
val homeViewModel = getActivityScopedViewModel<HomeViewModel>()
28-
val navigator = LocalCodeNavigator.current
29-
val coroutineScope = rememberCoroutineScope()
30-
ContentRestrictedView(restrictionType) {
31-
coroutineScope.launch {
32-
homeViewModel.logout()
33-
.onSuccess {
34-
navigator.replaceAll(
35-
ScreenRegistry.get(
36-
AppRoute.Onboarding.Login()
37-
)
38-
)
39-
}
40-
}
13+
@Composable
14+
fun AppRestrictedScreen(restrictionType: RestrictionType) {
15+
val homeViewModel = getActivityScopedViewModel<HomeViewModel>()
16+
val navigator = LocalCodeNavigator.current
17+
val coroutineScope = rememberCoroutineScope()
18+
ContentRestrictedView(restrictionType) {
19+
coroutineScope.launch {
20+
homeViewModel.logout()
21+
.onSuccess {
22+
navigator.replaceAll(
23+
AppRoute.Onboarding.Login()
24+
)
25+
}
4126
}
4227
}
43-
}
28+
}

0 commit comments

Comments
 (0)