Updated on 2026-08-14
This commit is contained in:
parent
418fbf710d
commit
8c47e9483c
20 changed files with 53 additions and 36 deletions
|
|
@ -349,6 +349,7 @@ internal class WalletModel @Inject constructor(
|
|||
value = info,
|
||||
onIssueOrderClick = ::issueOrder,
|
||||
onContinueKycClick = innerWalletRouter::openTangemPayOnboarding,
|
||||
cardOnClick = ::tangemPayCardOnClick,
|
||||
).transform(stateHolder.uiState.value.tangemPayState)
|
||||
}
|
||||
} ?: return
|
||||
|
|
@ -374,6 +375,10 @@ internal class WalletModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun tangemPayCardOnClick(customerWalletAddress: String) {
|
||||
innerWalletRouter.openTangemPayDetails(customerWalletAddress)
|
||||
}
|
||||
|
||||
private fun needToRefreshTimer() {
|
||||
modelScope.launch {
|
||||
delay(REFRESH_WALLET_BACKGROUND_TIMER_MILLIS)
|
||||
|
|
|
|||
|
|
@ -111,4 +111,8 @@ internal class DefaultWalletRouter @Inject constructor(
|
|||
override fun openTangemPayOnboarding() {
|
||||
router.push(AppRoute.TangemPayOnboarding(AppRoute.TangemPayOnboarding.Mode.ContinueOnboarding))
|
||||
}
|
||||
|
||||
override fun openTangemPayDetails(custoemrWalletAddress: String) {
|
||||
router.push(AppRoute.TangemPayDetails(custoemrWalletAddress))
|
||||
}
|
||||
}
|
||||
|
|
@ -60,4 +60,6 @@ internal interface InnerWalletRouter {
|
|||
fun openTokenReceiveBottomSheet(tokenReceiveConfig: TokenReceiveConfig)
|
||||
|
||||
fun openTangemPayOnboarding()
|
||||
|
||||
fun openTangemPayDetails(custoemrWalletAddress: String)
|
||||
}
|
||||
|
|
@ -20,5 +20,6 @@ internal sealed class TangemPayState {
|
|||
data class Card(
|
||||
val lastFourDigits: TextReference,
|
||||
val balanceText: TextReference,
|
||||
val onClick: () -> Unit,
|
||||
) : TangemPayState()
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ internal class TangemPayStateTransformer(
|
|||
private val value: MainScreenCustomerInfo? = null,
|
||||
private val onIssueOrderClick: () -> Unit = {},
|
||||
private val onContinueKycClick: () -> Unit = {},
|
||||
private val cardOnClick: (String) -> Unit = {},
|
||||
private val issueProgressState: Boolean = false,
|
||||
private val issueState: Boolean = false,
|
||||
) : Transformer<TangemPayState> {
|
||||
|
|
@ -63,6 +64,7 @@ internal class TangemPayStateTransformer(
|
|||
private fun getCardInfoState(cardInfo: CardInfo): TangemPayState = TangemPayState.Card(
|
||||
lastFourDigits = TextReference.Str("*${cardInfo.lastFourDigits}"),
|
||||
balanceText = TextReference.Str(getBalanceText(cardInfo)),
|
||||
onClick = { cardOnClick(cardInfo.customerWalletAddress) },
|
||||
)
|
||||
|
||||
private fun getBalanceText(cardInfo: CardInfo): String {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.feature.wallet.presentation.wallet.ui.components.singlecurrency
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Surface
|
||||
|
|
@ -21,7 +22,9 @@ import com.tangem.feature.wallet.presentation.wallet.state.model.TangemPayState
|
|||
@Composable
|
||||
internal fun TangemPayCardMainBlock(state: TangemPayState.Card, modifier: Modifier = Modifier) {
|
||||
Surface(
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.clickable { state.onClick() },
|
||||
shape = TangemTheme.shapes.roundedCornersXMedium,
|
||||
color = TangemTheme.colors.background.primary,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ private fun ResetCardScreenPreview() {
|
|||
TangemPayState.Card(
|
||||
lastFourDigits = TextReference.Str("*1234"),
|
||||
balanceText = TextReference.Str("$ 0.00"),
|
||||
onClick = {},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue