Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ sealed interface AppRoute : NavKey, Parcelable {
@Serializable
data class Purchase(val fromLogin: Boolean = false) : Onboarding

@Serializable
data class ContactPermission(val postCreate: Boolean): Onboarding
@Serializable
data class NotificationPermission(val postCreate: Boolean = false) : Onboarding
@Serializable
Expand Down Expand Up @@ -88,6 +90,8 @@ sealed interface AppRoute : NavKey, Parcelable {
val includeEmail: Boolean = true,
val email: String? = null,
val emailVerificationCode: String? = null,
val target: AppRoute? = null,
val fullScreen: Boolean = false,
) : AppRoute, FlowRouteWithResult<VerificationResult> {
override val initialStack: List<NavKey>
get() = buildVerificationInitialStack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ fun VerificationFlowScreen(
route = route,
value = NavResultOrCanceled.ReturnValue(result),
)
outerNavigator.pop()
if (route.target != null && result is VerificationResult.Success) {
outerNavigator.replace(route.target!!)
} else {
outerNavigator.pop()
}
},
entryProvider = verificationEntryProvider(route),
)
Expand All @@ -59,13 +63,13 @@ private fun verificationEntryProvider(
VerificationFlowIntroContent(isForOnRamp = step.isForOnRamp)
}
annotatedEntry<VerificationStep.PhoneEntry> {
PhoneVerificationContent()
PhoneVerificationContent(isInModal = !route.fullScreen)
}
annotatedEntry<VerificationStep.PhoneCode> {
PhoneCodeContent(includeEmail = route.includeEmail)
PhoneCodeContent(includeEmail = route.includeEmail, isInModal = !route.fullScreen)
}
annotatedEntry<VerificationStep.PhoneCountryCode> {
PhoneCountryCodeContent()
PhoneCountryCodeContent(isInModal = !route.fullScreen)
}
annotatedEntry<VerificationStep.EmailEntry> {
EmailVerificationContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.onEach
@Composable
fun PhoneCodeContent(
includeEmail: Boolean,
isInModal: Boolean = true,
) {
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
val viewModel = flowSharedViewModel<PhoneVerificationViewModel>()
Expand All @@ -34,7 +35,7 @@ fun PhoneCodeContent(
) {
AppBarWithTitle(
title = stringResource(R.string.title_enterTheCode),
isInModal = true,
isInModal = isInModal,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

@Composable
fun PhoneCountryCodeContent() {
fun PhoneCountryCodeContent(isInModal: Boolean = true) {
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
val viewModel = flowSharedViewModel<PhoneVerificationViewModel>()

Expand All @@ -30,7 +30,7 @@ fun PhoneCountryCodeContent() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_verifyPhoneNumber),
isInModal = true,
isInModal = isInModal,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

@Composable
fun PhoneVerificationContent() {
fun PhoneVerificationContent(isInModal: Boolean = true) {
val codeNavigator = LocalCodeNavigator.current
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
val viewModel = flowSharedViewModel<PhoneVerificationViewModel>()
Expand All @@ -37,7 +37,7 @@ fun PhoneVerificationContent() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_verifyPhoneNumber),
isInModal = true,
isInModal = isInModal,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
Expand Down
Loading