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 @@ -26,7 +26,6 @@ import com.flipcash.app.cash.CashScreen
import com.flipcash.app.contact.verification.VerificationFlowScreen
import com.flipcash.app.currencycreator.CurrencyCreatorFlowScreen
import com.flipcash.app.tipping.NewChatScreen
import com.flipcash.app.tipping.TipAmountEntryScreen
import com.flipcash.app.tipping.TippingFlowScreen
import com.flipcash.shared.transactionhistory.ActivityHistoryScreen
import com.flipcash.app.core.AppRoute
Expand Down Expand Up @@ -98,7 +97,6 @@ fun appEntryProvider(
TippingFlowScreen(route = key, resultStateRegistry = resultStateRegistry)
}
annotatedEntry<AppRoute.Sheets.TokenSelection> { key -> TokenSelectScreen(key.purpose) }
annotatedEntry<AppRoute.Sheets.TipAmountEntry> { TipAmountEntryScreen() }
annotatedEntry<AppRoute.Sheets.Wallet> {
// The wallet hosts the card-expand overlay in-entry so a pushed action (Give/Convert/Withdraw)
// covers the expanded currency-info with correct z-order (iOS WalletScreen structure).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ sealed interface AppRoute : NavKey, Parcelable {
data class Tips(val resumed: Boolean = false): Sheets {
}

/**
* Custom tip-amount entry, opened over the still-visible tip card + modal. The entered
* amount is written back to the shared tip selection so the modal reflects it on dismiss.
*/
@Serializable
data object TipAmountEntry : Sheets

@Serializable
data object Wallet : Sheets

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.flipcash.app.core.tipping

import androidx.compose.runtime.staticCompositionLocalOf
import com.flipcash.app.core.chat.ChatIdentifier
import com.getcode.opencode.model.core.ID
import com.getcode.opencode.model.financial.Fiat
import com.getcode.opencode.model.financial.Token
Expand Down Expand Up @@ -68,9 +67,6 @@ interface TipSelectionHolder {
/** Selects [amount] (a [TipAmount.Preset] or [TipAmount.Custom]); pass `null` to clear it. */
fun selectAmount(amount: TipAmount?)

/** Submits the current tip selection, driving [TipSelectionState.sendState] loading → success. */
fun confirmTip()

/**
* One-shot UI events the tip decorator should act on — e.g. opening the deposit flow
* after the user picks "Add Money" from an insufficient-balance prompt. Emitted by the
Expand All @@ -82,7 +78,6 @@ interface TipSelectionHolder {
object Empty : TipSelectionHolder {
override val selection: StateFlow<TipSelectionState> = MutableStateFlow(TipSelectionState())
override fun selectAmount(amount: TipAmount?) = Unit
override fun confirmTip() = Unit
override val events: Flow<TipEvent> = emptyFlow()
}
}
Expand All @@ -91,12 +86,6 @@ interface TipSelectionHolder {
sealed interface TipEvent {
/** Open [route] (e.g. the deposit flow) using the tip UI's navigator. */
data class OpenRoute(val route: AppRoute) : TipEvent

/**
* Launch the DM chat for a completed tip. The tip UI opens it through the tips flow so the
* tips list sits beneath the chat in the back stack (back returns to the list).
*/
data class LaunchChat(val identifier: ChatIdentifier) : TipEvent
}

/** Provides the active [TipSelectionHolder] (the tipping coordinator) to composables. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ sealed interface TokenPurpose: Parcelable {
*/
@Serializable data class BuyFunding(val target: Mint, val current: Mint) : TokenPurpose
@Serializable data class LaunchFunding(val amount: Fiat): TokenPurpose
@Serializable data class Tip(val amount: Fiat?): TriggersChange
@Serializable data object Withdraw: TokenPurpose
@Serializable data object Deposit: TokenPurpose
@Serializable data object Balance : TokenPurpose
Expand Down
3 changes: 0 additions & 3 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,7 @@
<string name="action_showTipCard">Show My Tip Card</string>
<string name="title_sendTip">Send a Tip</string>
<string name="action_sendToStartChatting">Send %1$s to Start Chatting</string>
<string name="title_amountToTip">Amount to Tip</string>
<string name="label_of">of</string>
<string name="action_swipeToTip">Swipe to Tip</string>
<string name="content_description_customTipAmount">Enter a custom amount</string>
<string name="subtitle_tipHintMinimum">%1$s minimum</string>
<string name="error_title_tipMinimum">%1$s Minimum Tip</string>
<string name="error_description_tipMinimum">Please enter a higher amount</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ internal fun ChatAmountEntryContent(
}
},
// A close X, not an up arrow: this is a sheet over the conversation, and dismissing
// it drops the amount rather than stepping back to a previous screen. Matches the
// other sheet-presented amount entry, TipAmountEntryScreen.
// it drops the amount rather than stepping back to a previous screen.
rightContents = {
AppBarDefaults.Close { onExit() }
},
Expand Down

This file was deleted.

This file was deleted.

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.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -18,8 +17,6 @@ import com.flipcash.app.tokens.ui.SelectTokenViewModel
import com.flipcash.app.tokens.ui.TokenListPresentation
import com.flipcash.features.tokens.R
import com.getcode.navigation.core.LocalCodeNavigator
import com.getcode.navigation.flow.FlowDismissStyle
import com.getcode.navigation.flow.LocalFlowDismissStyle
import com.getcode.ui.components.AppBarWithTitle
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterIsInstance
Expand All @@ -36,34 +33,24 @@ fun TokenSelectScreen(
val navigator = LocalCodeNavigator.current
val viewModel = hiltViewModel<SelectTokenViewModel>()

// Standalone selection sheets (Select / Tip) dismiss with a close (X); when the screen is a
// step pushed onto another stack we keep the ambient style — a flow host's back arrow (Swap) or
// the default. AppBarWithTitle auto-swaps the icon off LocalFlowDismissStyle.
val dismissStyle = when (purpose) {
is TokenPurpose.Tip -> FlowDismissStyle.Close
else -> LocalFlowDismissStyle.current
}

CompositionLocalProvider(LocalFlowDismissStyle provides dismissStyle) {
Column(
modifier = if (presentation.wrapHeight) Modifier.fillMaxWidth()
else Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (showTopBar) {
AppBarWithTitle(
title = when (purpose) {
is TokenPurpose.Swap -> stringResource(R.string.title_selectPaymentCurrency)
is TokenPurpose.LaunchFunding -> stringResource(R.string.title_selectPaymentCurrency)
else -> stringResource(R.string.title_selectCurrency)
},
onBackIconClicked = { navigator.pop() },
titleAlignment = Alignment.CenterHorizontally,
)
}

SelectTokenScreen(viewModel, presentation = presentation)
Column(
modifier = if (presentation.wrapHeight) Modifier.fillMaxWidth()
else Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (showTopBar) {
AppBarWithTitle(
title = when (purpose) {
is TokenPurpose.Swap -> stringResource(R.string.title_selectPaymentCurrency)
is TokenPurpose.LaunchFunding -> stringResource(R.string.title_selectPaymentCurrency)
else -> stringResource(R.string.title_selectCurrency)
},
onBackIconClicked = { navigator.pop() },
titleAlignment = Alignment.CenterHorizontally,
)
}

SelectTokenScreen(viewModel, presentation = presentation)
}

LaunchedEffect(viewModel) {
Expand Down Expand Up @@ -96,7 +83,6 @@ fun TokenSelectScreen(
navigator.push(Deposit())
}

is TokenPurpose.Tip -> Unit
is TokenPurpose.LaunchFunding -> Unit
is TokenPurpose.Swap -> Unit
is TokenPurpose.ConvertDestination -> Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ private fun SelectTokenScreenContent(
is TokenPurpose.Swap -> TokenSelectionStyle.Chevron
is TokenPurpose.LaunchFunding -> TokenSelectionStyle.Chevron
is TokenPurpose.Select -> TokenSelectionStyle.Checkbox
is TokenPurpose.Tip -> TokenSelectionStyle.Checkbox
is TokenPurpose.ConvertDestination -> TokenSelectionStyle.Checkbox
is TokenPurpose.BuyFunding -> TokenSelectionStyle.Checkbox
TokenPurpose.Withdraw -> TokenSelectionStyle.Chevron
Expand All @@ -97,7 +96,6 @@ private fun SelectTokenScreenContent(
is TokenPurpose.Select -> false
is TokenPurpose.Swap -> false
is TokenPurpose.LaunchFunding -> false
is TokenPurpose.Tip -> false
is TokenPurpose.ConvertDestination -> false
is TokenPurpose.BuyFunding -> false
else -> true
Expand All @@ -107,10 +105,6 @@ private fun SelectTokenScreenContent(
is TokenPurpose.LaunchFunding -> {
amount.nativeAmount.valueGreaterThanOrEqualTo(purpose.amount)
}
is TokenPurpose.Tip -> {
val target = purpose.amount ?: return@atLeast true
amount.nativeAmount.valueGreaterThanOrEqualTo(target)
}
else -> true
}
},
Expand Down
Loading
Loading