@@ -9,14 +9,18 @@ import androidx.compose.ui.platform.LocalUriHandler
99import androidx.compose.ui.platform.UriHandler
1010import androidx.navigation3.runtime.EntryProviderScope
1111import androidx.navigation3.runtime.NavKey
12+ import com.gemwallet.android.features.assets.presents.select.SelectAssetScreen
1213import com.gemwallet.android.features.in_app_notifications.presents.InAppNotificationsAction
1314import com.gemwallet.android.features.in_app_notifications.presents.InAppNotificationsScreen
1415import com.gemwallet.android.features.price_alerts.presents.AssetPriceAlertsScreen
16+ import com.gemwallet.android.features.price_alerts.presents.PriceAlertsAction
1517import com.gemwallet.android.features.price_alerts.presents.PriceAlertsScreen
1618import com.gemwallet.android.features.price_alerts.presents.SetPriceAlertScreen
19+ import com.gemwallet.android.features.settings.presents.NotificationsAction
1720import com.gemwallet.android.features.settings.presents.NotificationsScreen
1821import com.gemwallet.android.features.settings.presents.PreferencesScreen
1922import com.gemwallet.android.features.settings.presents.about_us.AboutUsScreen
23+ import com.gemwallet.android.features.settings.presents.chain_settings.ChainListSettingsAction
2024import com.gemwallet.android.features.settings.presents.chain_settings.ChainListSettingsScreen
2125import com.gemwallet.android.features.settings.presents.chain_settings.ChainSettingsScreen
2226import com.gemwallet.android.features.settings.presents.chain_settings.ServiceStatusScreen
@@ -35,6 +39,7 @@ import com.wallet.core.primitives.AssetId
3539import com.wallet.core.primitives.Chain
3640import kotlinx.serialization.Serializable
3741import uniffi.gemstone.GemNotificationDestination
42+ import uniffi.gemstone.GemSelectAssetType
3843
3944const val SettingsRoute = " settings"
4045
@@ -68,6 +73,9 @@ data object ServiceStatusRoute : NavKey
6873@Serializable
6974data object PriceAlertsRoute : NavKey
7075
76+ @Serializable
77+ data object PriceAlertSelectRoute : NavKey
78+
7179@Serializable
7280data class AssetPriceAlertsRoute (val assetId : AssetId ) : NavKey
7381
@@ -132,9 +140,13 @@ fun EntryProviderScope<NavKey>.settingsScreen(navigator: WalletNavigator, onPaym
132140
133141 entry<ChainListSettingsRoute > {
134142 ChainListSettingsScreen (
135- onSelectChain = navigator::openChainSettings,
136- onShowStatus = navigator::openServiceStatus,
137- onCancel = onCancel,
143+ onAction = { action ->
144+ when (action) {
145+ is ChainListSettingsAction .Select -> navigator.openChainSettings(action.chain)
146+ ChainListSettingsAction .ShowStatus -> navigator.openServiceStatus()
147+ ChainListSettingsAction .Cancel -> onCancel()
148+ }
149+ },
138150 )
139151 }
140152
@@ -152,8 +164,24 @@ fun EntryProviderScope<NavKey>.settingsScreen(navigator: WalletNavigator, onPaym
152164 PriceAlertsScreen (
153165 message = navigator.routeMessage(key),
154166 onMessageShown = { navigator.clearRouteMessage(key) },
155- onChart = navigator::openChart,
167+ selectedAsset = navigator.assetSelection(key),
168+ onSelectedAssetConsumed = { navigator.clearAssetSelection(key) },
169+ onAction = { action ->
170+ when (action) {
171+ PriceAlertsAction .Close -> onCancel()
172+ PriceAlertsAction .Add -> navigator.openPriceAlertSelect()
173+ is PriceAlertsAction .OpenChart -> navigator.openChart(action.assetId)
174+ }
175+ },
176+ )
177+ }
178+
179+ entry<PriceAlertSelectRoute > {
180+ SelectAssetScreen (
181+ selectType = GemSelectAssetType .PriceAlert ,
156182 onCancel = onCancel,
183+ onSelect = navigator::finishAssetSelect,
184+ onSelectRecent = null ,
157185 )
158186 }
159187
@@ -179,8 +207,12 @@ fun EntryProviderScope<NavKey>.settingsScreen(navigator: WalletNavigator, onPaym
179207
180208 entry<NotificationsRoute > {
181209 NotificationsScreen (
182- onPriceAlerts = navigator::openPriceAlerts,
183- onCancel = onCancel,
210+ onAction = { action ->
211+ when (action) {
212+ NotificationsAction .PriceAlerts -> navigator.openPriceAlerts()
213+ NotificationsAction .Cancel -> onCancel()
214+ }
215+ },
184216 )
185217 }
186218
0 commit comments