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 @@ -4,6 +4,7 @@ import android.os.Parcelable
import com.getcode.navigation.NonDismissableRoute
import com.getcode.navigation.NonDraggableRoute
import com.getcode.navigation.flow.FlowStep
import com.getcode.opencode.model.financial.Fiat
import com.getcode.opencode.model.ui.TokenBillCustomizations
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable
Expand Down Expand Up @@ -44,7 +45,11 @@ sealed interface CurrencyCreatorStep: FlowStep, Parcelable, NonDismissableRoute,

@Parcelize
@Serializable
data object BillReviewAndPurchase: CurrencyCreatorStep
data object BillReview: CurrencyCreatorStep

@Parcelize
@Serializable
data object FundingSourceSelection: CurrencyCreatorStep

@Parcelize
@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.flipcash.app.core.tokens

import android.os.Parcelable
import com.getcode.opencode.model.financial.Fiat
import com.getcode.opencode.model.financial.LocalFiat
import com.getcode.solana.keys.Mint
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable
Expand All @@ -11,7 +10,8 @@ import kotlinx.serialization.Serializable
@Parcelize
sealed interface TokenPurpose: Parcelable {
@Serializable data object Select : TokenPurpose
@Serializable data class Purchase(val desiredToken: Mint, val amount: Fiat) : TokenPurpose
@Serializable data class Swap(val desiredToken: Mint, val amount: Fiat) : TokenPurpose
@Serializable data class LaunchFunding(val amount: Fiat): TokenPurpose
@Serializable data object Withdraw: TokenPurpose
@Serializable data object Deposit: TokenPurpose
@Serializable data object Balance : TokenPurpose
Expand Down
3 changes: 3 additions & 0 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@
<string name="placeholder_currencyName">Currency Name</string>
<string name="placeholder_currencyTicker">$BadBoys</string>
<string name="action_buyFirstToCreate">Pay %1$s to Create</string>
<string name="title_readyToCreate">Ready To Create?</string>
<string name="description_readyToCreate">You won\'t be able to change the name once your currency is created.</string>
<string name="action_payToCreateCurrency">Pay To Create Currency</string>
<string name="title_creatingCurrency">Creating %1$s</string>
<string name="title_currencyIsLive">%1$s Is Live</string>
<string name="subtitle_currencyIsLive">Your currency is ready to receive and use</string>
Expand Down
1 change: 1 addition & 0 deletions apps/flipcash/features/currency-creator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ android {

dependencies {
implementation(project(":apps:flipcash:features:bill-customization"))
implementation(project(":apps:flipcash:features:tokens"))
implementation(project(":apps:flipcash:shared:bills"))
implementation(project(":apps:flipcash:shared:featureflags"))
implementation(project(":apps:flipcash:shared:currency-creator"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.flipcash.app.currencycreator

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -45,10 +44,10 @@ import com.flipcash.app.currencycreator.internal.screens.NameSelectionContent
import com.flipcash.app.currencycreator.internal.screens.NameSelectionScreen
import com.flipcash.app.currencycreator.internal.screens.ProcessingContent
import com.flipcash.app.currencycreator.internal.screens.ProcessingScreen
import com.flipcash.app.currencycreator.internal.screens.ReviewAndPurchaseContent
import com.flipcash.app.currencycreator.internal.screens.ReviewAndPurchaseScreen
import com.flipcash.app.currencycreator.internal.screens.ReviewContent
import com.flipcash.app.currencycreator.internal.screens.BillReviewScreen
import com.flipcash.app.currencycreator.internal.screens.FundingSourceSelectionScreen
import com.flipcash.app.session.LocalSessionController
import com.flipcash.app.theme.FlipcashPreview
import com.flipcash.app.theme.FlipcashThemeWrapper
import com.flipcash.core.R
import com.getcode.navigation.annotatedEntry
Expand Down Expand Up @@ -96,6 +95,21 @@ fun CurrencyCreatorFlowScreen(
)
}
}

// TokenSelectScreen's own top bar is hidden on this step (showTopBar = false)
// to avoid stacking two bars; surface its title here instead. Matches the
// LaunchFunding title the select screen would show, and like Bill Review this
// step shows no progress indicator (title replaces the progress slot).
is CurrencyCreatorStep.FundingSourceSelection -> {
{
Text(
text = stringResource(R.string.title_selectPaymentCurrency),
style = CodeTheme.typography.textLarge,
color = CodeTheme.colors.textMain,
)
}
}

is CurrencyCreatorStep.Processing -> {
{
val text = if (state.processingState.success) {
Expand Down Expand Up @@ -185,7 +199,8 @@ private fun currencyCreatorEntryProvider(): (NavKey) -> NavEntry<NavKey> = entry
annotatedEntry<CurrencyCreatorStep.IconSelection> { SyncTopBar(it); IconSelectionScreen() }
annotatedEntry<CurrencyCreatorStep.DescriptionSelection> { SyncTopBar(it); DescriptionSelectionScreen() }
annotatedEntry<CurrencyCreatorStep.BillCustomization> { SyncTopBar(it); BillCustomizationScreen() }
annotatedEntry<CurrencyCreatorStep.BillReviewAndPurchase> { SyncTopBar(it); ReviewAndPurchaseScreen() }
annotatedEntry<CurrencyCreatorStep.BillReview> { SyncTopBar(it); BillReviewScreen() }
annotatedEntry<CurrencyCreatorStep.FundingSourceSelection> { SyncTopBar(it); FundingSourceSelectionScreen() }
annotatedEntry<CurrencyCreatorStep.Processing> { SyncTopBar(it); ProcessingScreen() }
}

Expand Down Expand Up @@ -213,7 +228,7 @@ private fun SyncTopBar(step: CurrencyCreatorStep) {
topBar.onEndAction = {
val bill = billPlaygroundController.state.value.customizedBill
viewModel.dispatchEvent(CurrencyCreatorViewModel.Event.OnBillConfirmed(bill))
flowNavigator.navigateTo(CurrencyCreatorStep.BillReviewAndPurchase)
flowNavigator.navigateTo(CurrencyCreatorStep.BillReview)
}
}
}
Expand Down Expand Up @@ -286,7 +301,7 @@ private fun Preview_Bill() {
@PreviewWrapper(FlipcashThemeWrapper::class)
@Composable
private fun Preview_Review() {
CurrencyCreatorPreview { ReviewAndPurchaseContent(it) {} }
CurrencyCreatorPreview { ReviewContent(it) {} }
}

@Preview
Expand Down
Loading
Loading