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 @@ -34,7 +34,6 @@ fun AdvancedFeaturesScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_advancedFeatures),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fun AppSettingsScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_appSettings),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = navigator::pop
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fun BackupKeyScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_accessKey),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
)
BackupKeyScreenContent(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ fun EmailMagicLinkContent(
AppBarWithTitle(
title = stringResource(R.string.title_connectEmailAddress),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
EmailMagicLinkScreen(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fun EmailVerificationContent(
AppBarWithTitle(
title = stringResource(R.string.title_connectEmailAddress),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
keyboard.hideIfVisible {
codeNavigator.pop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fun PhoneCodeContent(
AppBarWithTitle(
title = stringResource(R.string.title_enterTheCode),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
PhoneCodeScreen(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fun PhoneCountryCodeContent() {
AppBarWithTitle(
title = stringResource(R.string.title_verifyPhoneNumber),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
PhoneCountryCodeScreen(viewModel = viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ fun PhoneVerificationContent() {
AppBarWithTitle(
title = stringResource(R.string.title_connectPhoneNumber),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
keyboard.hideIfVisible {
codeNavigator.pop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fun DepositDestinationScreen(mint: Mint) {
AppBarWithTitle(
title = stringResource(R.string.title_depositToken, state.tokenName.orEmpty()),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
)
DepositDestinationScreen(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ private fun DepositSelectTokenScreen() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_selectCurrency),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ internal fun UsdcDepositInformationScreen(showOtherOptions: Boolean) {
topBar = {
AppBarWithTitle(
title = stringResource(R.string.title_deposit),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fun DeviceLogsScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_deviceLogs),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
endContent = {
Box {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -16,7 +15,6 @@ import com.flipcash.core.R
import com.getcode.navigation.core.CodeNavigator
import com.getcode.navigation.core.LocalCodeNavigator
import com.getcode.opencode.model.ui.DiscoverCategory
import com.getcode.ui.components.AppBarDefaults
import com.getcode.ui.components.AppBarWithTitle
import kotlinx.coroutines.flow.filterIsInstance
import kotlinx.coroutines.flow.launchIn
Expand All @@ -27,28 +25,17 @@ import kotlinx.coroutines.flow.onEach
fun TokenDiscoveryScreen() {
val navigator = LocalCodeNavigator.current
val viewModel = hiltViewModel<TokenDiscoveryViewModel>()
val isSheetRoot = remember(navigator) { navigator.backStack.size <= 1 }

Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (isSheetRoot) {
AppBarWithTitle(
title = stringResource(R.string.title_discoverCurrencies),
titleAlignment = Alignment.CenterHorizontally,
endContent = {
AppBarDefaults.Close { navigator.hide() }
},
)
} else {
AppBarWithTitle(
title = stringResource(R.string.title_discoverCurrencies),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
)
}
// Sheet-aware app bar: a Close (✕) at the sheet root, a back arrow when pushed deeper.
AppBarWithTitle(
title = stringResource(R.string.title_discoverCurrencies),
titleAlignment = Alignment.CenterHorizontally,
onBackIconClicked = { navigator.navigateBack() },
)
TokenDiscoveryScreen(viewModel)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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 @@ -12,33 +11,21 @@ import com.flipcash.app.lab.internal.LabsScreenViewModel
import com.getcode.navigation.extensions.getActivityScopedViewModel
import com.flipcash.core.R
import com.getcode.navigation.core.LocalCodeNavigator
import com.getcode.ui.components.AppBarDefaults
import com.getcode.ui.components.AppBarWithTitle

@Composable
fun LabsScreen(onboarding: Boolean = false) {
val navigator = LocalCodeNavigator.current
val isSheetRoot = remember(navigator) { navigator.backStack.size <= 1 }
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (isSheetRoot) {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
endContent = {
AppBarDefaults.Close { navigator.hide() }
}
)
} else {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = navigator::pop
)
}
// Sheet-aware app bar: a Close (✕) at the sheet root, a back arrow when pushed deeper.
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
onBackIconClicked = { navigator.navigateBack() },
)

val viewModel = getActivityScopedViewModel<LabsScreenViewModel>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ private fun SeedInputStepContent() {
Column {
AppBarWithTitle(
modifier = Modifier.fillMaxWidth(),
backButton = true,
titleAlignment = Alignment.CenterHorizontally,
onBackIconClicked = { flowNavigator.back() },
title = stringResource(R.string.title_enterAccessKeyWords),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ private fun AccessKeyInPhotos(
modifier = Modifier.fillMaxWidth(),
title = stringResource(R.string.title_cantFindYourAccessKey),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = goBack,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal fun ChatProfileScreen(viewModel: ChatProfileViewModel) {

CodeScaffold(
topBar = {
AppBarWithTitle(backButton = true, onBackIconClicked = { flowNavigator.back() })
AppBarWithTitle(onBackIconClicked = { flowNavigator.back() })
},
) { innerPadding ->
MenuList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fun PurchaseAccountScreen(
val navigator = LocalCodeNavigator.current
Column {
AppBarWithTitle(
backButton = true,
onBackIconClicked = {
if (fromLogin) {
navigator.popAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ internal fun TipCardScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_myTipCard),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ internal fun PhantomConnectConfirmationScreen(
} else {
stringResource(R.string.title_purchase)
},
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down Expand Up @@ -181,7 +180,6 @@ internal fun PhantomTransactionConfirmationScreen() {
topBar = {
AppBarWithTitle(
title = stringResource(R.string.title_purchase),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ internal fun SwapEntryScreen(
is SwapPurpose.BalanceDecrease -> stringResource(R.string.title_amountToSell)
},
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
if (state.buyProgress.loading) {
// swallow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ internal fun BuyReceiptScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_confirmPurchase),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ fun TokenInfoScreen(
}
},
titleAlignment = Alignment.CenterHorizontally,
leftIcon = {
AppBarDefaults.UpNavigation { navigator.pop() }
},
rightContents = {
state.token.dataOrNull?.let {
if (!state.isCashReserve) {
Expand All @@ -74,6 +71,7 @@ fun TokenInfoScreen(
}
}
}
AppBarDefaults.Close { navigator.pop() }
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ fun TokenSelectScreen(
is TokenPurpose.LaunchFunding -> stringResource(R.string.title_selectPaymentCurrency)
else -> stringResource(R.string.title_selectCurrency)
},
backButton = true,
onBackIconClicked = { navigator.pop() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ internal fun SellReceiptScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_confirmSale),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
if (state.sellProgress.loading) {
// swallow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fun TransactionHistoryScreen(mint: Mint) {
AppBarWithTitle(
title = stringResource(R.string.title_transactionHistory),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() }
)
val viewModel = hiltViewModel<TransactionHistoryViewModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ internal fun NameEntryScreen(
Column {
if (allowBack) {
AppBarWithTitle(
backButton = true,
onBackIconClicked = {
keyboard.hideIfVisible {
flowNavigator.back()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ internal fun PhotoSelectionScreen() {

Column {
AppBarWithTitle(
backButton = true,
onBackIconClicked = {
keyboard.hideIfVisible {
flowNavigator.back()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ fun UserFlagsScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_userFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = navigator::pop,
endContent = {
AppBarDefaults.Reset { viewModel.dispatchEvent(UserFlagsViewModel.Event.Reset) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ private fun WithdrawalSelectTokenScreen() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_selectCurrency),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ internal fun UsdcWithdrawalInformationScreen(showOtherOptions: Boolean) {
topBar = {
AppBarWithTitle(
title = stringResource(R.string.title_withdraw),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ internal fun WithdrawalConfirmationScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_withdraw),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
WithdrawalConfirmationScreen(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ internal fun WithdrawalDestinationScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_withdraw),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
)
WithdrawalDestinationScreen(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ internal fun WithdrawalEntryScreen(
) {
AppBarWithTitle(
title = stringResource(R.string.title_withdraw),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fun RegionSelectionScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_selectRegion),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
navigator.pop()
}
Expand Down
Loading
Loading