Updated on 2026-08-14
This commit is contained in:
parent
ce948a71ae
commit
ad9def0d21
27 changed files with 6 additions and 291 deletions
|
|
@ -11,10 +11,8 @@ import com.tangem.datasource.local.onramp.paymentmethods.DefaultOnrampPaymentMet
|
|||
import com.tangem.datasource.local.onramp.paymentmethods.OnrampPaymentMethodsStore
|
||||
import com.tangem.datasource.local.onramp.quotes.DefaultOnrampQuotesStore
|
||||
import com.tangem.datasource.local.onramp.quotes.OnrampQuotesStore
|
||||
import com.tangem.datasource.local.onramp.sepa.DefaultOnrampCurrentCountryByIPStore
|
||||
import com.tangem.datasource.local.onramp.sepa.DefaultOnrampSepaAvailabilityStore
|
||||
import com.tangem.datasource.local.onramp.sepa.OnrampCurrentCountryByIPStore
|
||||
import com.tangem.datasource.local.onramp.sepa.OnrampSepaAvailabilityStore
|
||||
import com.tangem.datasource.local.onramp.country.DefaultOnrampCurrentCountryByIPStore
|
||||
import com.tangem.datasource.local.onramp.country.OnrampCurrentCountryByIPStore
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
|
|
@ -55,12 +53,6 @@ internal object OnrampStoreModule {
|
|||
return DefaultOnrampCurrenciesStore(dataStore = RuntimeDataStore())
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideOnrampSepaAvailableStore(): OnrampSepaAvailabilityStore {
|
||||
return DefaultOnrampSepaAvailabilityStore(dataStore = RuntimeDataStore())
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideOnrampCurrentCountryByIPStore(): OnrampCurrentCountryByIPStore {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.tangem.datasource.local.onramp.sepa
|
||||
package com.tangem.datasource.local.onramp.country
|
||||
|
||||
import com.tangem.datasource.local.datastore.core.StringKeyDataStore
|
||||
import com.tangem.datasource.local.datastore.core.StringKeyDataStoreDecorator
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.tangem.datasource.local.onramp.sepa
|
||||
package com.tangem.datasource.local.onramp.country
|
||||
|
||||
import com.tangem.domain.onramp.model.OnrampCountry
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.tangem.datasource.local.onramp.sepa
|
||||
|
||||
import com.tangem.datasource.local.datastore.core.StringKeyDataStore
|
||||
import com.tangem.datasource.local.datastore.core.StringKeyDataStoreDecorator
|
||||
|
||||
internal class DefaultOnrampSepaAvailabilityStore(
|
||||
val dataStore: StringKeyDataStore<Boolean>,
|
||||
) : OnrampSepaAvailabilityStore, StringKeyDataStoreDecorator<OnrampSepaAvailabilityStoreKey, Boolean>(
|
||||
wrappedDataStore = dataStore,
|
||||
) {
|
||||
override fun provideStringKey(key: OnrampSepaAvailabilityStoreKey) = with(key) {
|
||||
buildString {
|
||||
append(userWallet.walletId.toString())
|
||||
append("_")
|
||||
append(country.code)
|
||||
append("_")
|
||||
append(cryptoCurrency.id.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.tangem.datasource.local.onramp.sepa
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface OnrampSepaAvailabilityStore {
|
||||
suspend fun getSyncOrNull(key: OnrampSepaAvailabilityStoreKey): Boolean?
|
||||
fun get(key: OnrampSepaAvailabilityStoreKey): Flow<Boolean>
|
||||
suspend fun store(key: OnrampSepaAvailabilityStoreKey, value: Boolean)
|
||||
suspend fun clear()
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package com.tangem.datasource.local.onramp.sepa
|
||||
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.onramp.model.OnrampCountry
|
||||
|
||||
data class OnrampSepaAvailabilityStoreKey(
|
||||
val userWallet: UserWallet,
|
||||
val country: OnrampCountry,
|
||||
val cryptoCurrency: CryptoCurrency,
|
||||
)
|
||||
|
|
@ -11,9 +11,6 @@ import androidx.datastore.preferences.core.emptyPreferences
|
|||
import androidx.datastore.preferences.preferencesDataStoreFile
|
||||
import com.tangem.datasource.local.preferences.PreferencesDataStore.INSTANCE
|
||||
import com.tangem.datasource.local.preferences.PreferencesKeys.APP_LOGS_KEY
|
||||
import com.tangem.datasource.local.preferences.PreferencesKeys.IS_TOKEN_SWAP_PROMO_OKX_SHOW_KEY
|
||||
import com.tangem.datasource.local.preferences.PreferencesKeys.IS_WALLET_SWAP_PROMO_OKX_SHOW_KEY
|
||||
import com.tangem.datasource.local.preferences.PreferencesKeys.SHOULD_SHOW_RING_PROMO_KEY
|
||||
import com.tangem.datasource.local.preferences.utils.CleanupKeyMigration
|
||||
import com.tangem.datasource.local.preferences.utils.SharedPreferencesKeyMigration
|
||||
import com.tangem.datasource.local.preferences.utils.SwapCurrencyIdMigration
|
||||
|
|
@ -83,9 +80,6 @@ internal object PreferencesDataStore {
|
|||
),
|
||||
SwapCurrencyIdMigration(),
|
||||
CleanupKeyMigration(key = APP_LOGS_KEY),
|
||||
CleanupKeyMigration(key = IS_WALLET_SWAP_PROMO_OKX_SHOW_KEY),
|
||||
CleanupKeyMigration(key = IS_TOKEN_SWAP_PROMO_OKX_SHOW_KEY),
|
||||
CleanupKeyMigration(key = SHOULD_SHOW_RING_PROMO_KEY),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -87,23 +87,10 @@ object PreferencesKeys {
|
|||
|
||||
val UNSUBMITTED_TRANSACTIONS_KEY by lazy { stringPreferencesKey(name = "unsubmittedTransactions") }
|
||||
|
||||
@Deprecated("Remove after CleanupKeyMigration")
|
||||
val IS_WALLET_SWAP_PROMO_OKX_SHOW_KEY by lazy {
|
||||
booleanPreferencesKey(name = "isWalletSwapPromoOkxShown")
|
||||
}
|
||||
|
||||
@Deprecated("Remove after CleanupKeyMigration")
|
||||
val IS_TOKEN_SWAP_PROMO_OKX_SHOW_KEY by lazy {
|
||||
booleanPreferencesKey(name = "isTokenSwapPromoOkxShown")
|
||||
}
|
||||
|
||||
val apiConfigsEnvironmentKey by lazy { stringPreferencesKey(name = "apiConfigsEnvironment") }
|
||||
|
||||
val ADDED_WALLETS_WITH_RING_KEY by lazy { stringSetPreferencesKey(name = "addedWalletsWithRing") }
|
||||
|
||||
@Deprecated("Remove after CleanupKeyMigration")
|
||||
val SHOULD_SHOW_RING_PROMO_KEY by lazy { booleanPreferencesKey(name = "shouldShowRingPromo") }
|
||||
|
||||
val ONRAMP_DEFAULT_COUNTRY by lazy { stringPreferencesKey(name = "onrampDefaultCountry") }
|
||||
|
||||
val ONRAMP_TRANSACTIONS_STATUSES_KEY by lazy { stringPreferencesKey(name = "onrampTransactionsStatuses") }
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.*
|
||||
import com.tangem.core.ui.components.buttons.common.TangemButtonSize
|
||||
|
|
@ -520,15 +519,5 @@ private class NotificationConfigProvider : CollectionPreviewParameterProvider<No
|
|||
subtitle = resourceReference(id = R.string.information_generated_with_ai),
|
||||
iconResId = R.drawable.ic_magic_28,
|
||||
),
|
||||
NotificationConfig(
|
||||
title = resourceReference(R.string.notification_sepa_title),
|
||||
subtitle = resourceReference(R.string.notification_sepa_text),
|
||||
iconResId = R.drawable.img_notification_sepa,
|
||||
buttonsState = NotificationConfig.ButtonsState.SecondaryButtonConfig(
|
||||
text = resourceReference(R.string.notification_sepa_button),
|
||||
onClick = { },
|
||||
),
|
||||
iconSize = 54.dp,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -551,16 +551,6 @@ private class TangemMessageLegacyPreviewProvider : PreviewParameterProvider<Noti
|
|||
subtitle = resourceReference(id = R.string.information_generated_with_ai),
|
||||
iconResId = R.drawable.ic_magic_28,
|
||||
),
|
||||
NotificationConfig(
|
||||
title = resourceReference(R.string.notification_sepa_title),
|
||||
subtitle = resourceReference(R.string.notification_sepa_text),
|
||||
iconResId = R.drawable.img_notification_sepa,
|
||||
buttonsState = ButtonsState.SecondaryButtonConfig(
|
||||
text = resourceReference(R.string.notification_sepa_button),
|
||||
onClick = { },
|
||||
),
|
||||
iconSize = 54.dp,
|
||||
),
|
||||
)
|
||||
}
|
||||
// endregion
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
Loading…
Add table
Add a link
Reference in a new issue