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 @@ -33,7 +33,6 @@ import com.flipcash.app.discovery.TokenDiscoveryScreen
import com.flipcash.app.internal.ui.navigation.decorators.rememberNavMessagingEntryDecorator
import com.flipcash.app.lab.LabsScreen
import com.flipcash.app.lab.NavBarSettingsScreen
import com.flipcash.app.lab.StandaloneLabsScreen
import com.flipcash.app.login.OnboardingFlowScreen
import com.flipcash.app.menu.MenuScreen
import com.flipcash.app.myaccount.MyAccountScreen
Expand Down Expand Up @@ -88,7 +87,6 @@ fun appEntryProvider(
annotatedEntry<AppRoute.Sheets.Wallet> { BalanceScreen() }
annotatedEntry<AppRoute.Sheets.ShareApp> { ShareAppScreen() }
annotatedEntry<AppRoute.Sheets.Menu> { MenuScreen() }
annotatedEntry<AppRoute.Sheets.Lab> { StandaloneLabsScreen() }


// Tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ sealed interface AppRoute : NavKey, Parcelable {
data object Wallet : Sheets
@Serializable
data object Menu : Sheets
@Serializable
data object Lab : Sheets

@Serializable
data object ShareApp : Sheets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.flipcash.app.lab
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -17,49 +18,32 @@ import com.getcode.ui.components.AppBarWithTitle
@Composable
fun LabsScreen() {
val navigator = LocalCodeNavigator.current

Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
isInModal = true,
onBackIconClicked = navigator::pop
)

val viewModel = getActivityScopedViewModel<LabsScreenViewModel>()

LabsScreenContent(viewModel)
}
}

@Composable
fun StandaloneLabsScreen() {
val navigator = LocalCodeNavigator.current

val isSheetRoot = remember { navigator.backStack.size <= 1 }
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
isInModal = true,
endContent = {
AppBarDefaults.Close { navigator.hide() }
}
)
if (isSheetRoot) {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
isInModal = true,
endContent = {
AppBarDefaults.Close { navigator.hide() }
}
)
} else {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
isInModal = true,
onBackIconClicked = navigator::pop
)
}

val viewModel = getActivityScopedViewModel<LabsScreenViewModel>()

LabsScreenContent(viewModel)
}
}

@Composable
fun PreloadLabs() {
val viewModel = getActivityScopedViewModel<LabsScreenViewModel>()
}
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private fun LoginStepContent(seed: String?) {
login = { flowNavigator.navigateTo(OnboardingStep.SeedInput) },
isLabsOpen = state.betaOptionsVisible,
onLogoTapped = { vm.dispatchEvent(LoginViewModel.Event.OnLogoTapped) },
openBetaFlags = { outerNavigator.openAsSheet(AppRoute.Sheets.Lab) },
openBetaFlags = { outerNavigator.openAsSheet(AppRoute.Menu.Lab) },
)
}
}
Expand Down
Loading