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 @@ -14,7 +14,6 @@ private fun AppBarTitleOnGivePreview() {
FlipcashPreview(showBackground = true) {

AppBarWithTitle(
isInModal = true,
leftIcon = { AppBarDefaults.UpNavigation() { }},
title = {
TokenSelectionPill(
Expand Down
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,
isInModal = true,
backButton = true,
onBackIconClicked = { navigator.pop() }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fun AppSettingsScreen() {
title = stringResource(R.string.title_appSettings),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
isInModal = true,
onBackIconClicked = navigator::pop
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ fun BackupKeyScreen() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_accessKey),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fun BalanceScreen() {
) {
AppBarWithTitle(
title = stringResource(R.string.title_wallet),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
endContent = {
AppBarDefaults.Close { navigator.hide() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun CashScreen(
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = {
TokenSelectionPill(state.token?.token) {
navigator.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ private fun verificationEntryProvider(
VerificationFlowIntroContent(isForOnRamp = step.isForOnRamp)
}
annotatedEntry<VerificationStep.PhoneEntry> {
PhoneVerificationContent(isInModal = !route.fullScreen)
PhoneVerificationContent()
}
annotatedEntry<VerificationStep.PhoneCode> {
PhoneCodeContent(
includeEmail = route.includeEmail,
isInModal = !route.fullScreen,
linkForPayment = route.linkForPayment,
)
}
annotatedEntry<VerificationStep.PhoneCountryCode> {
PhoneCountryCodeContent(isInModal = !route.fullScreen)
PhoneCountryCodeContent()
}
annotatedEntry<VerificationStep.EmailEntry> {
EmailVerificationContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ fun EmailMagicLinkContent(
) {
AppBarWithTitle(
title = stringResource(R.string.title_connectEmailAddress),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ fun EmailVerificationContent(
) {
AppBarWithTitle(
title = stringResource(R.string.title_connectEmailAddress),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ private fun VerificationFlowIntroScreenContent(
topBar = {
if (isSheetRoot) {
AppBarWithTitle(
isInModal = true,
endContent = {
AppBarDefaults.Close { navigator.hide() }
},
)
} else {
AppBarWithTitle(
isInModal = true,
backButton = true,
onBackIconClicked = { navigator.pop() },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import kotlinx.coroutines.flow.onEach
@Composable
fun PhoneCodeContent(
includeEmail: Boolean,
isInModal: Boolean = true,
linkForPayment: Boolean = false,
) {
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
Expand All @@ -36,7 +35,6 @@ fun PhoneCodeContent(
) {
AppBarWithTitle(
title = stringResource(R.string.title_enterTheCode),
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(isInModal: Boolean = true) {
fun PhoneCountryCodeContent() {
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
val viewModel = flowSharedViewModel<PhoneVerificationViewModel>()

Expand All @@ -30,7 +30,6 @@ fun PhoneCountryCodeContent(isInModal: Boolean = true) {
) {
AppBarWithTitle(
title = stringResource(R.string.title_verifyPhoneNumber),
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(isInModal: Boolean = true) {
fun PhoneVerificationContent() {
val codeNavigator = LocalCodeNavigator.current
val flowNavigator = rememberFlowNavigator<VerificationStep, VerificationResult>()
val viewModel = flowSharedViewModel<PhoneVerificationViewModel>()
Expand All @@ -37,7 +37,6 @@ fun PhoneVerificationContent(isInModal: Boolean = true) {
) {
AppBarWithTitle(
title = stringResource(R.string.title_connectPhoneNumber),
isInModal = isInModal,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ internal fun CurrencyCreatorTopBar(
val keyboard = rememberKeyboardController()

AppBarWithTitle(
isInModal = true,
title = { mainContent?.invoke() ?: defaultMainContent() },
titleAlignment = Alignment.CenterHorizontally,
leftIcon = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fun DepositDestinationScreen(mint: Mint) {
) {
AppBarWithTitle(
title = stringResource(R.string.title_depositToken, state.tokenName.orEmpty()),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ private fun DepositSelectTokenScreen() {
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = stringResource(R.string.title_selectCurrency),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
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),
isInModal = true,
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,
isInModal = true,
backButton = true,
onBackIconClicked = { navigator.pop() },
endContent = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import com.getcode.navigation.flow.FlowHost
import com.getcode.navigation.flow.flowSharedViewModel
import com.getcode.navigation.results.NavResultStateRegistry
import com.getcode.navigation.scenes.LocalBottomSheetDismissDispatcher
import com.getcode.ui.utils.rememberKeyboardController

@Composable
fun SendFlowScreen(resultStateRegistry: NavResultStateRegistry) {
val sheetDismiss = LocalBottomSheetDismissDispatcher.current
val viewModel = hiltViewModel<SendFlowViewModel>()
val state by viewModel.stateFlow.collectAsStateWithLifecycle()

val keyboard = rememberKeyboardController()
FlowHost<SendStep, SendResult>(
steps = state.steps,
resumeAt = 0,
Expand All @@ -36,7 +37,7 @@ fun SendFlowScreen(resultStateRegistry: NavResultStateRegistry) {
when (reason) {
is FlowExitReason.Completed,
FlowExitReason.BackedOutOfRoot,
FlowExitReason.Canceled -> sheetDismiss()
FlowExitReason.Canceled -> keyboard.hideIfVisible { sheetDismiss() }
}
},
entryProvider = sendEntryProvider(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ internal fun ContactListScreen() {
AppBarWithTitle(
title = stringResource(R.string.title_send),
titleAlignment = Alignment.CenterHorizontally,
isInModal = true,
endContent = {
AppBarDefaults.Close { flowNavigator.exitCanceled() }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ internal fun ContactsPermissionGateScreen() {
topBar = {
AppBarWithTitle(
title = "",
isInModal = true,
endContent = {
AppBarDefaults.Close { flowNavigator.exitCanceled() }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ internal fun PhoneGateLandingScreen() {
topBar = {
AppBarWithTitle(
title = "",
isInModal = true,
endContent = {
AppBarDefaults.Close { flowNavigator.exitCanceled() }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fun TokenDiscoveryScreen() {
if (isSheetRoot) {
AppBarWithTitle(
title = stringResource(R.string.title_discoverCurrencies),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
endContent = {
AppBarDefaults.Close { navigator.hide() }
Expand All @@ -45,7 +44,6 @@ fun TokenDiscoveryScreen() {
} else {
AppBarWithTitle(
title = stringResource(R.string.title_discoverCurrencies),
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
onBackIconClicked = { navigator.pop() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fun LabsScreen(onboarding: Boolean = false) {
AppBarWithTitle(
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
isInModal = true,
endContent = {
AppBarDefaults.Close { navigator.hide() }
}
Expand All @@ -37,7 +36,6 @@ fun LabsScreen(onboarding: Boolean = false) {
title = stringResource(R.string.title_betaFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
isInModal = true,
onBackIconClicked = navigator::pop
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ fun NavBarSettingsScreen() {
AppBarWithTitle(
title = "",
titleAlignment = Alignment.CenterHorizontally,
isInModal = true,
endContent = {
AppBarDefaults.Close { dismiss() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ internal fun MenuScreenContent(viewModel: MenuScreenViewModel) {
topBar = {
AppBarWithTitle(
modifier = Modifier.fillMaxWidth(),
isInModal = true,
title = stringResource(R.string.title_settings),
titleAlignment = Alignment.CenterHorizontally,
endContent = { AppBarDefaults.Close { navigator.hide() } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ internal fun ChatAmountEntryContent(
onChangeCurrency = { navigator.push(AppRoute.Main.RegionSelection) },
appBar = {
AppBarWithTitle(
isInModal = true,
title = {
TokenSelectionPill(token) {
navigator.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fun MyAccountScreen() {
text = stringResource(R.string.title_myAccount),
)
},
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
leftIcon = { AppBarDefaults.UpNavigation { navigator.pop() } },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fun UserProfileScreen() {
text = stringResource(R.string.title_userProfile),
)
},
isInModal = true,
titleAlignment = Alignment.CenterHorizontally,
leftIcon = { AppBarDefaults.UpNavigation { navigator.pop() } },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ fun ShareAppScreen() {
modifier = androidx.compose.ui.Modifier.fillMaxSize(),
) {
AppBarWithTitle(
isInModal = true,
titleAlignment = androidx.compose.ui.Alignment.CenterHorizontally,
endContent = { AppBarDefaults.Close { navigator.hide() } }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ internal fun PhantomConnectConfirmationScreen() {
topBar = {
AppBarWithTitle(
title = stringResource(R.string.title_purchase),
isInModal = true,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
Expand Down Expand Up @@ -148,7 +147,6 @@ internal fun PhantomTransactionConfirmationScreen() {
topBar = {
AppBarWithTitle(
title = stringResource(R.string.title_purchase),
isInModal = true,
backButton = true,
onBackIconClicked = { flowNavigator.back() },
titleAlignment = Alignment.CenterHorizontally,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ internal fun SwapEntryScreen(
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = when (purpose) {
is SwapPurpose.Buy if purpose.fundingSource != FundingSource.Flexible ->
stringResource(R.string.title_amountToDeposit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ fun TokenInfoScreen(
val viewModel = hiltViewModel<TokenInfoViewModel>()
val state by viewModel.stateFlow.collectAsStateWithLifecycle()
AppBarWithTitle(
isInModal = true,
title = {
state.token.dataOrNull?.let { token ->
TokenIconWithName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fun TokenSelectScreen(purpose: TokenPurpose) {
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = stringResource(R.string.title_selectCurrency),
backButton = true,
onBackIconClicked = { navigator.pop() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ internal fun SellReceiptScreen() {
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = stringResource(R.string.title_sellToken, state.tokenName),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private fun TokenTxProcessingScreen(
processingState = state.processingProgress,
topBar = {
AppBarWithTitle(
isInModal = true,
title = when (val purpose = state.purpose) {
is SwapPurpose.Buy if purpose.fundingSource != FundingSource.Flexible ->
stringResource(R.string.title_depositingToken, state.tokenName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fun TransactionHistoryScreen(mint: Mint) {
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = stringResource(R.string.title_transactionHistory),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fun UserFlagsScreen() {
title = stringResource(R.string.title_userFlags),
titleAlignment = Alignment.CenterHorizontally,
backButton = true,
isInModal = 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 @@ -113,7 +113,6 @@ private fun WithdrawalSelectTokenScreen() {
horizontalAlignment = Alignment.CenterHorizontally,
) {
AppBarWithTitle(
isInModal = true,
title = stringResource(R.string.title_selectCurrency),
backButton = true,
onBackIconClicked = { flowNavigator.back() },
Expand Down
Loading
Loading