Updated on 2026-08-14
This commit is contained in:
parent
e2bc4626b2
commit
4cc5788126
14 changed files with 177 additions and 41 deletions
|
|
@ -37,7 +37,7 @@ import com.tangem.features.send.v2.api.SendEntryPointComponent
|
|||
import com.tangem.features.staking.api.StakingComponent
|
||||
import com.tangem.features.swap.SwapComponent
|
||||
import com.tangem.features.swap.v2.api.SendWithSwapComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsContainerComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayOnboardingComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayOnboardingComponent.Params.ContinueOnboarding
|
||||
import com.tangem.features.tangempay.components.TangemPayOnboardingComponent.Params.Deeplink
|
||||
|
|
@ -113,7 +113,7 @@ internal class ChildFactory @Inject constructor(
|
|||
private val forgetWalletComponentFactory: ForgetWalletComponent.Factory,
|
||||
private val sendWithSwapComponentFactory: SendWithSwapComponent.Factory,
|
||||
private val sendEntryPointComponentFactory: SendEntryPointComponent.Factory,
|
||||
private val tangemPayDetailsComponentFactory: TangemPayDetailsComponent.Factory,
|
||||
private val tangemPayDetailsContainerComponentFactory: TangemPayDetailsContainerComponent.Factory,
|
||||
private val tangemPayOnboardingComponentFactory: TangemPayOnboardingComponent.Factory,
|
||||
private val kycComponentFactory: KycComponent.Factory,
|
||||
private val yieldSupplyPromoComponentFactory: YieldSupplyPromoComponent.Factory,
|
||||
|
|
@ -634,8 +634,11 @@ internal class ChildFactory @Inject constructor(
|
|||
is AppRoute.TangemPayDetails -> {
|
||||
createComponentChild(
|
||||
context = context,
|
||||
params = TangemPayDetailsComponent.Params(userWalletId = route.userWalletId, config = route.config),
|
||||
componentFactory = tangemPayDetailsComponentFactory,
|
||||
params = TangemPayDetailsContainerComponent.Params(
|
||||
userWalletId = route.userWalletId,
|
||||
config = route.config,
|
||||
),
|
||||
componentFactory = tangemPayDetailsContainerComponentFactory,
|
||||
)
|
||||
}
|
||||
is AppRoute.TangemPayOnboarding -> {
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@
|
|||
<string name="common_import">Importieren</string>
|
||||
<string name="common_in_progress">In Arbeit</string>
|
||||
<string name="common_later">Später</string>
|
||||
<string name="common_learn_more">Mehr erfahren</string>
|
||||
<string name="common_learn_more">Mehr erfahren</string>
|
||||
<string name="common_left">%1$s übrig</string>
|
||||
<string name="common_legacy_bitcoin_address">Legacy Bitcoin</string>
|
||||
<string name="common_locked">Gesperrt</string>
|
||||
|
|
@ -1200,7 +1200,7 @@
|
|||
<string name="staking_reward_schedule_month">Monatlich</string>
|
||||
<string name="staking_reward_schedule_week">Wöchentlich</string>
|
||||
<string name="staking_rewards">Belohnungen</string>
|
||||
<string name="staking_soloana_details_auto_claiming_rewards_daily_text">Belohnungen auf Solana werden automatisch Deinem Staking-Guthaben hinzugefügt und können nicht separat angezeigt werden.</string>
|
||||
<string name="staking_solana_details_auto_claiming_rewards_daily_text">Belohnungen auf Solana werden automatisch Deinem Staking-Guthaben hinzugefügt und können nicht separat angezeigt werden.</string>
|
||||
<string name="staking_stake_locked">Stake gesperrt</string>
|
||||
<string name="staking_stake_more">Mehr staken</string>
|
||||
<string name="staking_stake_more_button_unavailability_reason">Beim Staking %1$s wird Dein gesamtes %2$s -Guthaben eingesetzt. Alle weiteren %2$s due Du in Deine Tangem-Wallet einzahlst, werden ebenfalls automatisch eingesetzt.</string>
|
||||
|
|
|
|||
|
|
@ -1202,7 +1202,7 @@
|
|||
<string name="staking_reward_schedule_month">毎月</string>
|
||||
<string name="staking_reward_schedule_week">毎週</string>
|
||||
<string name="staking_rewards">報酬</string>
|
||||
<string name="staking_soloana_details_auto_claiming_rewards_daily_text">Solanaの報酬は自動的にステーキング残高に追加され、個別に表示することはできません。</string>
|
||||
<string name="staking_solana_details_auto_claiming_rewards_daily_text">Solanaの報酬は自動的にステーキング残高に追加され、個別に表示することはできません。</string>
|
||||
<string name="staking_stake_locked">ステーキングはロックされています</string>
|
||||
<string name="staking_stake_more">もっとステーキングする</string>
|
||||
<string name="staking_stake_more_button_unavailability_reason">%1$sをステーキングすると、 %2$s残高全体がステーキングされます。Tangemウォレットに入金した追加の%2$sも、自動的にステーキングされます。</string>
|
||||
|
|
@ -1732,7 +1732,7 @@
|
|||
<string name="yield_module_fee_policy_sheet_min_amount_note">取引手数料は、預入額の4%未満である必要があります。Tangemは、この条件を満たす十分な残高が貯まった時点で、Aaveへの資金移動を行います。</string>
|
||||
<string name="yield_module_fee_policy_sheet_min_amount_title">最低入金額</string>
|
||||
<string name="yield_module_fee_policy_sheet_title">手数料ポリシー</string>
|
||||
<string name="yield_module_fee_policy_tangem_service_fee_title">Tangemはまた、得られた利回りに対して3%のサービス手数料を差し引きます。</string>
|
||||
<string name="yield_module_fee_policy_tangem_service_fee_title">Tangemはまた、得られた利回りに対して3% のサービス手数料を差し引きます。</string>
|
||||
<string name="yield_module_high_fee_error">ネットワーク手数料が現在高すぎます。設定した上限を下回るまで待機しています。</string>
|
||||
<string name="yield_module_historical_returns">過去のリターン</string>
|
||||
<string name="yield_module_main_view_approve_notification_description">ここに説明を入力してください。1〜3行が理想的です。[プレースホルダー]</string>
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@
|
|||
<string name="common_import">Импортировать</string>
|
||||
<string name="common_in_progress">В процессе</string>
|
||||
<string name="common_later">Позже</string>
|
||||
<string name="common_learn_more">Узнать больше</string>
|
||||
<string name="common_learn_more">Узнать больше</string>
|
||||
<string name="common_left">Осталось %1$s</string>
|
||||
<string name="common_locked">Заблокирован</string>
|
||||
<string name="common_main_network">Основная сеть</string>
|
||||
|
|
@ -1142,7 +1142,7 @@
|
|||
<string name="staking_reward_schedule_month">Месяц</string>
|
||||
<string name="staking_reward_schedule_week">Еженедельно</string>
|
||||
<string name="staking_rewards">Вознаграждения</string>
|
||||
<string name="staking_soloana_details_auto_claiming_rewards_daily_text">Вознаграждения в сети Solana автоматически добавляются к вашему стейкинг-балансу и не могут отображаться отдельно.</string>
|
||||
<string name="staking_solana_details_auto_claiming_rewards_daily_text">Вознаграждения в сети Solana автоматически добавляются к вашему стейкинг-балансу и не могут отображаться отдельно.</string>
|
||||
<string name="staking_stake_locked">Стейкинг закрыт</string>
|
||||
<string name="staking_stake_more">Застейкать еще</string>
|
||||
<string name="staking_stake_more_button_unavailability_reason">При стейкинге %1$s используется весь ваш баланс в %2$s. Любой дополнительный %2$s депозит будет автоматически застейкан.</string>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
<string name="account_archived_recover_error_message">You have already exceeded the limit of 20 active accounts. Archive one to recover.</string>
|
||||
<string name="account_archived_recover_error_title">Can\'t recover account</string>
|
||||
<string name="account_archived_title">Archived</string>
|
||||
<string name="account_could_not_archive">We couldn’t archive account. Please try again later.</string>
|
||||
<string name="account_could_not_create">We couldn’t create account. Please try again later.</string>
|
||||
<string name="account_create_success_message">Account created</string>
|
||||
<string name="account_details_archive">Archive account</string>
|
||||
|
|
@ -255,6 +256,7 @@
|
|||
<string name="common_fee_selector_option_slow">Slow</string>
|
||||
<string name="common_fee_selector_title">Speed and fee</string>
|
||||
<string name="common_finish">Finish</string>
|
||||
<string name="common_forget">Forget</string>
|
||||
<string name="common_free">Free</string>
|
||||
<string name="common_from">From</string>
|
||||
<string name="common_generate_addresses">Synchronize addresses</string>
|
||||
|
|
@ -268,7 +270,7 @@
|
|||
<string name="common_import">Import</string>
|
||||
<string name="common_in_progress">In progress</string>
|
||||
<string name="common_later">Later</string>
|
||||
<string name="common_learn_more">Learn more</string>
|
||||
<string name="common_learn_more">Learn more</string>
|
||||
<string name="common_left">%1$s left</string>
|
||||
<string name="common_legacy_bitcoin_address">Legacy Bitcoin</string>
|
||||
<string name="common_locked">Locked</string>
|
||||
|
|
@ -536,15 +538,21 @@
|
|||
<string name="hw_activation_need_warning_description">Complete setup by securing the app with an access code.</string>
|
||||
<string name="hw_backup_alert_description">If you do, you\'ll need to start over.</string>
|
||||
<string name="hw_backup_alert_title">Are you sure you want to quit the activation process?</string>
|
||||
<string name="hw_backup_banner_description">Keeps your crypto safe and offline. Slim as a credit card, safer than a bank vault.</string>
|
||||
<string name="hw_backup_close_description">If you do, you\'ll need to start over.</string>
|
||||
<string name="hw_backup_google_drive_description">Recover existing wallet via Google Drive backup</string>
|
||||
<string name="hw_backup_google_drive_title">Google Drive backup</string>
|
||||
<string name="hw_backup_hardware_create_description">Create a new secure wallet and transfer your funds for extra protection.</string>
|
||||
<string name="hw_backup_hardware_create_title">Create new wallet</string>
|
||||
<string name="hw_backup_hardware_description">Level up your security with the superior Tangem hardware wallet.</string>
|
||||
<string name="hw_backup_hardware_title">Hardware Wallet</string>
|
||||
<string name="hw_backup_hardware_upgrade_description">Move your current wallet into Tangem Wallet.</string>
|
||||
<string name="hw_backup_hardware_upgrade_title">Upgrade current wallet</string>
|
||||
<string name="hw_backup_need_action">Go to backup</string>
|
||||
<string name="hw_backup_need_description">Please back up your wallet before creating an access code.</string>
|
||||
<string name="hw_backup_need_title">Finalize backup first</string>
|
||||
<string name="hw_backup_no_backup">Incomplete</string>
|
||||
<string name="hw_backup_section_other_title">Other methods</string>
|
||||
<string name="hw_backup_seed_description">Physical devices that securely store your private key offline.</string>
|
||||
<string name="hw_backup_seed_title">Recovery phrase</string>
|
||||
<string name="hw_create_keys_description">Your private keys are securely encrypted and stored on your phone</string>
|
||||
|
|
@ -1229,7 +1237,7 @@
|
|||
<string name="staking_reward_schedule_month">Monthly</string>
|
||||
<string name="staking_reward_schedule_week">Weekly</string>
|
||||
<string name="staking_rewards">Rewards</string>
|
||||
<string name="staking_soloana_details_auto_claiming_rewards_daily_text">Rewards on Solana are automatically added to your staking balance and cannot be shown separately.</string>
|
||||
<string name="staking_solana_details_auto_claiming_rewards_daily_text">Rewards on Solana are automatically added to your staking balance and cannot be shown separately.</string>
|
||||
<string name="staking_stake_locked">Stake locked</string>
|
||||
<string name="staking_stake_more">Stake more</string>
|
||||
<string name="staking_stake_more_button_unavailability_reason">When staking %1$s, your entire %2$s balance is staked. Any additional %2$s you deposit to your Tangem Wallet will also be automatically staked.</string>
|
||||
|
|
@ -1313,7 +1321,9 @@
|
|||
<string name="tangem_pay_transaction_declined_notification_text">The bank rejected this transaction request.</string>
|
||||
<string name="tangem_pay_transaction_fee_notification_text">This fee goes to cover the cost of handling your transfer.</string>
|
||||
<string name="tangem_pay_withdrawal">Withdrawal</string>
|
||||
<string name="tangempay_card_details_change_pin">Change PIN</string>
|
||||
<string name="tangempay_card_details_error_text">Failed to load data. Try again later.</string>
|
||||
<string name="tangempay_card_details_freeze_card">Freeze Card</string>
|
||||
<string name="tangempay_card_details_hide_text">Hide</string>
|
||||
<string name="tangempay_card_details_receive_error_description">Technical issues detected. Please try again later or contact support.</string>
|
||||
<string name="tangempay_card_details_receive_error_title">Receive unavailable now</string>
|
||||
|
|
@ -1348,6 +1358,7 @@
|
|||
<string name="token_button_unavailability_reason_pending_transaction_send">Sending funds will be available once the pending transaction(s) in network %s is complete</string>
|
||||
<string name="token_button_unavailability_reason_sell_unavailable">Selling %s is not supported by current providers, but we are working to add more options.</string>
|
||||
<string name="token_button_unavailability_reason_staking_unavailable">Staking %s is not supported by current providers, but we are working to add more options.</string>
|
||||
<string name="token_button_unavailability_reason_yield_supply_approval">Text here</string>
|
||||
<string name="token_details_generate_xpub">Generate XPUB</string>
|
||||
<string name="token_details_hide_alert_hide">Hide</string>
|
||||
<string name="token_details_hide_alert_message">You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page.</string>
|
||||
|
|
@ -1817,7 +1828,7 @@
|
|||
<string name="yield_module_fee_policy_sheet_description">All future %s top-ups will be supplied to Aave automatically, with the transaction fee deducted.</string>
|
||||
<string name="yield_module_fee_policy_sheet_max_fee_note">If network fees rise above maximum fee, the transaction won’t go through until they decrease. You can change this limit later.</string>
|
||||
<string name="yield_module_fee_policy_sheet_max_fee_title">Maximum fee</string>
|
||||
<string name="yield_module_fee_policy_sheet_min_amount_note">The transaction fee must stay below 4% of your deposit. Tangem will transfer funds to Aave only once your balance is large enough to meet this condition. </string>
|
||||
<string name="yield_module_fee_policy_sheet_min_amount_note">The transaction fee must stay below 4% of your deposit. Tangem will transfer funds to Aave only once your balance is large enough to meet this condition.</string>
|
||||
<string name="yield_module_fee_policy_sheet_min_amount_title">Minimal top-up</string>
|
||||
<string name="yield_module_fee_policy_sheet_title">Fee policy</string>
|
||||
<string name="yield_module_fee_policy_tangem_service_fee_title">Tangem also takes a 3% service fee on the yield earned.</string>
|
||||
|
|
@ -1836,7 +1847,7 @@
|
|||
<string name="yield_module_promo_screen_self_custodial_title">Decentralized and self-custodial</string>
|
||||
<string name="yield_module_promo_screen_terms_disclaimer">By using service, you agree with provider\n%1$s and %2$s</string>
|
||||
<string name="yield_module_promo_screen_title">Connect Aave</string>
|
||||
<string name="yield_module_promo_screen_variable_rate_info">Aave %1$s% • Variable Interest Rate</string>
|
||||
<string name="yield_module_promo_screen_variable_rate_info">Aave %1$s%% • Variable Interest Rate</string>
|
||||
<string name="yield_module_provider">Aave</string>
|
||||
<string name="yield_module_rate_info_sheet_chart_average">Avg %s</string>
|
||||
<string name="yield_module_rate_info_sheet_chart_title">Last year returns</string>
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ private fun StakingRewardBlock(
|
|||
TangemTheme.colors.text.tertiary
|
||||
}
|
||||
RewardBlockType.RewardUnavailable.SolanaRewardUnavailable -> {
|
||||
resourceReference(R.string.staking_soloana_details_auto_claiming_rewards_daily_text) to
|
||||
resourceReference(R.string.staking_solana_details_auto_claiming_rewards_daily_text) to
|
||||
TangemTheme.colors.text.tertiary
|
||||
}
|
||||
RewardBlockType.NoRewards -> {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.tangem.core.ui.decompose.ComposableContentComponent
|
|||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.pay.TangemPayDetailsConfig
|
||||
|
||||
interface TangemPayDetailsComponent : ComposableContentComponent {
|
||||
interface TangemPayDetailsContainerComponent : ComposableContentComponent {
|
||||
data class Params(val userWalletId: UserWalletId, val config: TangemPayDetailsConfig)
|
||||
interface Factory : ComponentFactory<Params, TangemPayDetailsComponent>
|
||||
interface Factory : ComponentFactory<Params, TangemPayDetailsContainerComponent>
|
||||
}
|
||||
|
|
@ -19,6 +19,9 @@ dependencies {
|
|||
implementation(projects.core.navigation)
|
||||
implementation(projects.core.ui)
|
||||
|
||||
/** Common */
|
||||
implementation(projects.common.ui)
|
||||
|
||||
/** Features api */
|
||||
implementation(projects.features.tangempay.details.api)
|
||||
implementation(projects.features.txhistory.api)
|
||||
|
|
@ -43,6 +46,9 @@ dependencies {
|
|||
implementation(deps.compose.ui.tooling)
|
||||
implementation(deps.decompose.ext.compose)
|
||||
|
||||
/** AndroidX */
|
||||
implementation(deps.androidx.activity.compose)
|
||||
|
||||
/** DI */
|
||||
implementation(deps.hilt.android)
|
||||
kapt(deps.hilt.kapt)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
package com.tangem.features.tangempay.components
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.arkivanov.decompose.ComponentContext
|
||||
import com.arkivanov.decompose.extensions.compose.stack.Children
|
||||
import com.arkivanov.decompose.extensions.compose.stack.animation.stackAnimation
|
||||
import com.arkivanov.decompose.extensions.compose.subscribeAsState
|
||||
import com.arkivanov.decompose.router.stack.StackNavigation
|
||||
import com.arkivanov.decompose.router.stack.childStack
|
||||
import com.arkivanov.decompose.router.stack.pop
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import com.tangem.core.decompose.context.childByContext
|
||||
import com.tangem.core.decompose.navigation.inner.InnerRouter
|
||||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.features.tangempay.navigation.TangemPayDetailsInnerRoute
|
||||
import com.tangem.features.tokenreceive.TokenReceiveComponent
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
||||
class DefaultTangemPayDetailsContainerComponent @AssistedInject constructor(
|
||||
@Assisted private val appComponentContext: AppComponentContext,
|
||||
@Assisted private val params: TangemPayDetailsContainerComponent.Params,
|
||||
private val tokenReceiveComponentFactory: TokenReceiveComponent.Factory,
|
||||
) : AppComponentContext by appComponentContext, TangemPayDetailsContainerComponent {
|
||||
|
||||
private val stackNavigation = StackNavigation<TangemPayDetailsInnerRoute>()
|
||||
|
||||
private val innerRouter = InnerRouter<TangemPayDetailsInnerRoute>(
|
||||
stackNavigation = stackNavigation,
|
||||
popCallback = { onChildBack() },
|
||||
)
|
||||
|
||||
private val childStack = childStack(
|
||||
key = "tangemPayDetailsInnerStack",
|
||||
source = stackNavigation,
|
||||
serializer = TangemPayDetailsInnerRoute.serializer(),
|
||||
initialConfiguration = TangemPayDetailsInnerRoute.Details,
|
||||
childFactory = ::screenChild,
|
||||
)
|
||||
|
||||
@Composable
|
||||
override fun Content(modifier: Modifier) {
|
||||
val childStack by childStack.subscribeAsState()
|
||||
|
||||
BackHandler(onBack = router::pop)
|
||||
Children(stack = childStack, animation = stackAnimation()) { child ->
|
||||
child.instance.Content(modifier = modifier)
|
||||
}
|
||||
}
|
||||
|
||||
private fun screenChild(
|
||||
config: TangemPayDetailsInnerRoute,
|
||||
componentContext: ComponentContext,
|
||||
): ComposableContentComponent = when (config) {
|
||||
TangemPayDetailsInnerRoute.Details -> TangemPayDetailsComponent(
|
||||
appComponentContext = childByContext(componentContext),
|
||||
innerRouter = innerRouter,
|
||||
params = params,
|
||||
tokenReceiveComponentFactory = tokenReceiveComponentFactory,
|
||||
)
|
||||
TangemPayDetailsInnerRoute.ChangePIN -> TODO(" [REDACTED_JIRA]")
|
||||
}
|
||||
|
||||
private fun onChildBack() {
|
||||
when (childStack.value.active.configuration) {
|
||||
TangemPayDetailsInnerRoute.ChangePIN -> stackNavigation.pop()
|
||||
TangemPayDetailsInnerRoute.Details -> router.pop()
|
||||
}
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : TangemPayDetailsContainerComponent.Factory {
|
||||
override fun create(
|
||||
context: AppComponentContext,
|
||||
params: TangemPayDetailsContainerComponent.Params,
|
||||
): DefaultTangemPayDetailsContainerComponent
|
||||
}
|
||||
}
|
||||
|
|
@ -12,25 +12,25 @@ import com.tangem.core.decompose.context.AppComponentContext
|
|||
import com.tangem.core.decompose.context.child
|
||||
import com.tangem.core.decompose.context.childByContext
|
||||
import com.tangem.core.decompose.model.getOrCreateModel
|
||||
import com.tangem.core.decompose.navigation.Router
|
||||
import com.tangem.core.ui.components.NavigationBar3ButtonsScrim
|
||||
import com.tangem.core.ui.decompose.ComposableBottomSheetComponent
|
||||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.features.tangempay.components.txHistory.DefaultTangemPayTxHistoryComponent
|
||||
import com.tangem.features.tangempay.components.txHistory.TangemPayTxHistoryDetailsComponent
|
||||
import com.tangem.features.tangempay.model.TangemPayDetailsModel
|
||||
import com.tangem.features.tangempay.entity.TangemPayDetailsNavigation
|
||||
import com.tangem.features.tangempay.ui.TangemPayDetailsScreen
|
||||
import com.tangem.features.tokenreceive.TokenReceiveComponent
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
||||
internal class DefaultTangemPayDetailsComponent @AssistedInject constructor(
|
||||
@Assisted private val appComponentContext: AppComponentContext,
|
||||
@Assisted private val params: TangemPayDetailsComponent.Params,
|
||||
internal class TangemPayDetailsComponent(
|
||||
private val appComponentContext: AppComponentContext,
|
||||
innerRouter: Router,
|
||||
private val params: TangemPayDetailsContainerComponent.Params,
|
||||
private val tokenReceiveComponentFactory: TokenReceiveComponent.Factory,
|
||||
) : AppComponentContext by appComponentContext, TangemPayDetailsComponent {
|
||||
) : AppComponentContext by appComponentContext, ComposableContentComponent {
|
||||
|
||||
private val model: TangemPayDetailsModel = getOrCreateModel(params = params)
|
||||
private val model: TangemPayDetailsModel = getOrCreateModel(params = params, router = innerRouter)
|
||||
|
||||
private val bottomSheetSlot = childSlot(
|
||||
source = model.bottomSheetNavigation,
|
||||
|
|
@ -83,12 +83,4 @@ internal class DefaultTangemPayDetailsComponent @AssistedInject constructor(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : TangemPayDetailsComponent.Factory {
|
||||
override fun create(
|
||||
context: AppComponentContext,
|
||||
params: TangemPayDetailsComponent.Params,
|
||||
): DefaultTangemPayDetailsComponent
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.tangem.features.tangempay.di
|
||||
|
||||
import com.tangem.features.tangempay.components.DefaultTangemPayDetailsComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsComponent
|
||||
import com.tangem.features.tangempay.components.DefaultTangemPayDetailsContainerComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsContainerComponent
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
|
|
@ -14,7 +14,7 @@ internal interface TangemPayDetailsFeatureModule {
|
|||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun bindTangemPayDetailsComponentFactory(
|
||||
factory: DefaultTangemPayDetailsComponent.Factory,
|
||||
): TangemPayDetailsComponent.Factory
|
||||
fun bindTangemPayDetailsContainerComponentFactory(
|
||||
factory: DefaultTangemPayDetailsContainerComponent.Factory,
|
||||
): TangemPayDetailsContainerComponent.Factory
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@ package com.tangem.features.tangempay.entity
|
|||
import com.tangem.core.ui.components.buttons.actions.ActionButtonConfig
|
||||
import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig
|
||||
import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig.ShowRefreshState
|
||||
import com.tangem.core.ui.components.dropdownmenu.TangemDropdownMenuItem
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.features.tangempay.details.impl.R
|
||||
import com.tangem.features.tangempay.utils.CardDetailsFormatUtil
|
||||
import com.tangem.utils.StringsSigns
|
||||
|
|
@ -14,6 +16,7 @@ private const val CARD_NUMBER_SART_DIGITS_COUNT = 12
|
|||
private const val DATE_PART_LENGTH = 2
|
||||
private const val CVV_LENGTH = 3
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
internal class TangemPayDetailsStateFactory(
|
||||
private val cardNumberEnd: String,
|
||||
private val onBack: () -> Unit,
|
||||
|
|
@ -21,6 +24,8 @@ internal class TangemPayDetailsStateFactory(
|
|||
private val onReceive: () -> Unit,
|
||||
private val onReveal: () -> Unit,
|
||||
private val onCopy: (String) -> Unit,
|
||||
private val onClickChangePin: () -> Unit,
|
||||
private val onClickFreezeCard: () -> Unit,
|
||||
) {
|
||||
|
||||
private val cardStartMasked = maskedBlock(CARD_NUMBER_SART_DIGITS_COUNT)
|
||||
|
|
@ -28,7 +33,21 @@ internal class TangemPayDetailsStateFactory(
|
|||
private val cvvMasked = maskedBlock(CVV_LENGTH)
|
||||
|
||||
fun getInitialState() = TangemPayDetailsUM(
|
||||
topBarConfig = TangemPayDetailsTopBarConfig(onBackClick = onBack, items = null),
|
||||
topBarConfig = TangemPayDetailsTopBarConfig(
|
||||
onBackClick = onBack,
|
||||
items = persistentListOf(
|
||||
TangemDropdownMenuItem(
|
||||
title = TextReference.Res(R.string.tangempay_card_details_change_pin),
|
||||
textColorProvider = { TangemTheme.colors.text.primary1 },
|
||||
onClick = onClickChangePin,
|
||||
),
|
||||
TangemDropdownMenuItem(
|
||||
title = TextReference.Res(R.string.tangempay_card_details_freeze_card),
|
||||
textColorProvider = { TangemTheme.colors.text.primary1 },
|
||||
onClick = onClickFreezeCard,
|
||||
),
|
||||
),
|
||||
),
|
||||
pullToRefreshConfig = PullToRefreshConfig(isRefreshing = false, onRefresh = onRefresh),
|
||||
balanceBlockState = TangemPayDetailsBalanceBlockState.Loading(
|
||||
actionButtons = persistentListOf(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import com.tangem.domain.models.TokenReceiveType
|
|||
import com.tangem.domain.pay.DataForReceiveFactory
|
||||
import com.tangem.domain.pay.repository.CardDetailsRepository
|
||||
import com.tangem.domain.visa.model.TangemPayTxHistoryItem
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsComponent
|
||||
import com.tangem.features.tangempay.components.TangemPayDetailsContainerComponent
|
||||
import com.tangem.features.tangempay.details.impl.R
|
||||
import com.tangem.features.tangempay.entity.TangemPayDetailsErrorType
|
||||
import com.tangem.features.tangempay.entity.TangemPayDetailsNavigation
|
||||
|
|
@ -57,7 +57,7 @@ internal class TangemPayDetailsModel @Inject constructor(
|
|||
private val uiMessageSender: UiMessageSender,
|
||||
) : Model(), TangemPayTxHistoryUiActions {
|
||||
|
||||
private val params: TangemPayDetailsComponent.Params = paramsContainer.require()
|
||||
private val params: TangemPayDetailsContainerComponent.Params = paramsContainer.require()
|
||||
|
||||
private val stateFactory = TangemPayDetailsStateFactory(
|
||||
cardNumberEnd = params.config.cardNumberEnd,
|
||||
|
|
@ -66,6 +66,8 @@ internal class TangemPayDetailsModel @Inject constructor(
|
|||
onReceive = ::onClickReceive,
|
||||
onReveal = ::revealCardDetails,
|
||||
onCopy = ::copyData,
|
||||
onClickChangePin = ::onClickChangePin,
|
||||
onClickFreezeCard = ::onClickFreezeCard,
|
||||
)
|
||||
|
||||
val uiState: StateFlow<TangemPayDetailsUM>
|
||||
|
|
@ -81,6 +83,14 @@ internal class TangemPayDetailsModel @Inject constructor(
|
|||
fetchBalance()
|
||||
}
|
||||
|
||||
private fun onClickChangePin() {
|
||||
// TODO [REDACTED_JIRA]
|
||||
}
|
||||
|
||||
private fun onClickFreezeCard() {
|
||||
// TODO [REDACTED_JIRA]
|
||||
}
|
||||
|
||||
private fun onClickReceive() {
|
||||
val depositAddress = params.config.depositAddress
|
||||
if (depositAddress == null) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.features.tangempay.navigation
|
||||
|
||||
import com.tangem.core.decompose.navigation.Route
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal sealed class TangemPayDetailsInnerRoute : Route {
|
||||
@Serializable
|
||||
data object Details : TangemPayDetailsInnerRoute()
|
||||
|
||||
@Serializable
|
||||
data object ChangePIN : TangemPayDetailsInnerRoute()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue