Skip to content

Commit aa02bb6

Browse files
committed
chore: remove token selection from bill playground flow and remove from beta flag
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 283e163 commit aa02bb6

File tree

9 files changed

+21
-15
lines changed

9 files changed

+21
-15
lines changed

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/tokens/TokenPurpose.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ sealed interface TokenPurpose: Parcelable {
99
data object Withdraw: TokenPurpose
1010
data object Deposit: TokenPurpose
1111
data object Balance : TokenPurpose
12-
data object BillPlayground: TokenPurpose
1312
}

apps/flipcash/features/advanced/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dependencies {
5252
implementation(Libs.compose_material)
5353
implementation(Libs.compose_materialIconsExtended)
5454

55+
implementation(project(":apps:flipcash:shared:bill-customization"))
5556
implementation(project(":apps:flipcash:shared:featureflags"))
5657
implementation(project(":apps:flipcash:shared:menu"))
5758
implementation(project(":apps:flipcash:core"))

apps/flipcash/features/advanced/src/main/kotlin/com/flipcash/app/advanced/AdvancedFeaturesScreen.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ import cafe.adriel.voyager.core.screen.uniqueScreenKey
1414
import cafe.adriel.voyager.hilt.getViewModel
1515
import com.flipcash.app.advanced.internal.AdvancedFeaturesScreen
1616
import com.flipcash.app.advanced.internal.AdvancedFeaturesScreenViewModel
17+
import com.flipcash.app.bill.customization.LocalBillPlaygroundController
1718
import com.flipcash.core.R
1819
import com.getcode.navigation.core.LocalCodeNavigator
1920
import com.getcode.navigation.modal.ModalScreen
2021
import com.getcode.navigation.screens.NamedScreen
22+
import com.getcode.opencode.model.financial.Token
23+
import com.getcode.opencode.model.financial.usdc
2124
import com.getcode.ui.components.AppBarWithTitle
2225
import kotlinx.coroutines.flow.filterIsInstance
2326
import kotlinx.coroutines.flow.launchIn
@@ -38,7 +41,7 @@ class AdvancedFeaturesScreen: ModalScreen, NamedScreen, Parcelable {
3841
@Composable
3942
override fun ModalContent() {
4043
val navigator = LocalCodeNavigator.current
41-
44+
val billPlayground = LocalBillPlaygroundController.current
4245
val viewModel = getViewModel<AdvancedFeaturesScreenViewModel>()
4346

4447
Column(
@@ -63,5 +66,15 @@ class AdvancedFeaturesScreen: ModalScreen, NamedScreen, Parcelable {
6366
.onEach { navigator.push(it) }
6467
.launchIn(this)
6568
}
69+
70+
LaunchedEffect(viewModel) {
71+
viewModel.eventFlow
72+
.filterIsInstance<AdvancedFeaturesScreenViewModel.Event.OpenBillPlayground>()
73+
.onEach {
74+
navigator.hide()
75+
billPlayground.customizeFor(Token.usdc)
76+
}
77+
.launchIn(this)
78+
}
6679
}
6780
}

apps/flipcash/features/advanced/src/main/kotlin/com/flipcash/app/advanced/internal/AdvancedFeatureMenuItems.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ internal data object BillCustomizer : FullMenuItem<AdvancedFeaturesScreenViewMod
2727
@Composable get() = rememberVectorPainter(Icons.Outlined.Palette)
2828
override val name: String
2929
@Composable get() = stringResource(R.string.title_billCustomizer)
30-
override val action: AdvancedFeaturesScreenViewModel.Event = AdvancedFeaturesScreenViewModel.Event.OpenScreen(
31-
AppRoute.Sheets.TokenSelection(TokenPurpose.BillPlayground))
30+
override val action: AdvancedFeaturesScreenViewModel.Event = AdvancedFeaturesScreenViewModel.Event.OpenBillPlayground
3231
}

apps/flipcash/features/advanced/src/main/kotlin/com/flipcash/app/advanced/internal/AdvancedFeaturesScreenViewModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ internal class AdvancedFeaturesScreenViewModel @Inject constructor(
3737
data class OnBetaFeaturesUnlocked(val unlocked: Boolean) : Event
3838
data class OnBillCustomizerEnabled(val enabled: Boolean) : Event
3939
data class OpenScreen(val screen: AppRoute) : Event
40+
41+
data object OpenBillPlayground: Event
4042
}
4143

4244
init {
@@ -75,6 +77,7 @@ internal class AdvancedFeaturesScreenViewModel @Inject constructor(
7577
}
7678

7779
is Event.OpenScreen -> { state -> state }
80+
is Event.OpenBillPlayground -> { state -> state }
7881
}
7982
}
8083
}

apps/flipcash/features/tokens/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dependencies {
5353
implementation(Libs.compose_materialIconsExtended)
5454

5555
implementation(project(":apps:flipcash:shared:shareable"))
56-
implementation(project(":apps:flipcash:shared:bill-customization"))
5756
implementation(project(":apps:flipcash:shared:tokens"))
5857
implementation(project(":apps:flipcash:core"))
5958

apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/SelectTokenScreen.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import cafe.adriel.voyager.core.registry.ScreenRegistry
1212
import cafe.adriel.voyager.core.screen.ScreenKey
1313
import cafe.adriel.voyager.core.screen.uniqueScreenKey
1414
import cafe.adriel.voyager.hilt.getViewModel
15-
import com.flipcash.app.bill.customization.LocalBillPlaygroundController
1615
import com.flipcash.app.core.AppRoute.Main.Give
1716
import com.flipcash.app.core.AppRoute.Menu.Deposit
1817
import com.flipcash.app.core.AppRoute.Transfers.Withdrawal.Amount
@@ -66,7 +65,6 @@ class SelectTokenScreen(private val purpose: TokenPurpose) : ModalScreen, NamedS
6665
viewModel.dispatchEvent(SelectTokenViewModel.Event.OnPurposeChanged(purpose))
6766
}
6867

69-
val billPlayground = LocalBillPlaygroundController.current
7068
LaunchedEffect(viewModel) {
7169
viewModel.eventFlow
7270
.filterIsInstance<SelectTokenViewModel.Event.OnTokenSelected>()
@@ -89,11 +87,6 @@ class SelectTokenScreen(private val purpose: TokenPurpose) : ModalScreen, NamedS
8987
ScreenRegistry.get(Deposit(token.address))
9088
)
9189
}
92-
93-
TokenPurpose.BillPlayground -> {
94-
navigator.hide()
95-
billPlayground.customizeFor(token)
96-
}
9790
}
9891
}.launchIn(this)
9992
}

apps/flipcash/shared/featureflags/src/main/kotlin/com/flipcash/app/featureflags/FeatureFlag.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ sealed interface FeatureFlag {
6666
@FeatureFlagMarker
6767
data object BillCustomizer: FeatureFlag {
6868
override val key: String = "bill_customizer_enabled"
69-
override val default: Boolean = false
70-
override val launched: Boolean = false
69+
override val default: Boolean = true
70+
override val launched: Boolean = true
7171
override val visible: Boolean = true
7272
override val persistLogOut: Boolean = false
7373
}

apps/flipcash/shared/tokens/src/main/kotlin/SelectTokenViewModel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class SelectTokenViewModel @Inject constructor(
5656
TokenPurpose.Send -> exchange.observeEntryRate()
5757
TokenPurpose.Withdraw -> flowOf(exchange.rateForUsd())
5858
TokenPurpose.Deposit -> exchange.observeEntryRate()
59-
TokenPurpose.BillPlayground -> exchange.observeBalanceRate()
6059
}
6160
) { balances, rate ->
6261
balances.map {

0 commit comments

Comments
 (0)