diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/approve/WcApproveTransactionUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/approve/WcApproveTransactionUM.kt index f899662751..42c283e2e1 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/approve/WcApproveTransactionUM.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/approve/WcApproveTransactionUM.kt @@ -1,20 +1,17 @@ package com.tangem.features.walletconnect.transaction.entity.approve import androidx.annotation.DrawableRes -import androidx.compose.runtime.Immutable import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent import com.tangem.features.walletconnect.transaction.entity.common.WcNetworkInfoUM import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionAppInfoContentUM import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionRequestInfoUM -@Immutable internal data class WcApproveTransactionUM( val transaction: WcApproveTransactionItemUM, val transactionRequestInfo: WcTransactionRequestInfoUM, val customAllowance: WcCustomAllowanceUM, ) -@Immutable internal data class WcApproveTransactionItemUM( val onDismiss: () -> Unit, val onSend: () -> Unit, @@ -26,7 +23,6 @@ internal data class WcApproveTransactionItemUM( val isLoading: Boolean = false, ) : TangemBottomSheetConfigContent -@Immutable internal data class WcCustomAllowanceUM( @DrawableRes val networkIconRes: Int, val tokenIconUrl: String, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcNetworkInfoUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcNetworkInfoUM.kt index e0706d7cd7..788036d8fd 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcNetworkInfoUM.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcNetworkInfoUM.kt @@ -1,9 +1,7 @@ package com.tangem.features.walletconnect.transaction.entity.common import androidx.annotation.DrawableRes -import androidx.compose.runtime.Immutable -@Immutable internal data class WcNetworkInfoUM( val name: String, @DrawableRes val iconRes: Int, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcTransactionRequestInfoUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcTransactionRequestInfoUM.kt index 946ace922b..37bf3b7fde 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcTransactionRequestInfoUM.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcTransactionRequestInfoUM.kt @@ -1,22 +1,18 @@ package com.tangem.features.walletconnect.transaction.entity.common -import androidx.compose.runtime.Immutable import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent import com.tangem.core.ui.extensions.TextReference import kotlinx.collections.immutable.ImmutableList -@Immutable internal data class WcTransactionRequestInfoUM( val blocks: ImmutableList, val onCopy: () -> Unit, ) : TangemBottomSheetConfigContent -@Immutable internal data class WcTransactionRequestBlockUM( val info: ImmutableList, ) -@Immutable internal data class WcTransactionRequestInfoItemUM( val title: TextReference, val description: String = "", diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/sign/WcSignTransactionUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/sign/WcSignTransactionUM.kt index 3487650bd4..48a1bc062e 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/sign/WcSignTransactionUM.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/sign/WcSignTransactionUM.kt @@ -1,18 +1,15 @@ package com.tangem.features.walletconnect.transaction.entity.sign -import androidx.compose.runtime.Immutable import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent import com.tangem.features.walletconnect.transaction.entity.common.WcNetworkInfoUM import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionAppInfoContentUM import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionRequestInfoUM -@Immutable internal data class WcSignTransactionUM( val transaction: WcSignTransactionItemUM, val transactionRequestInfo: WcTransactionRequestInfoUM, ) -@Immutable internal data class WcSignTransactionItemUM( val onDismiss: () -> Unit, val onSign: () -> Unit, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/approve/WcSpendAllowanceItem.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/approve/WcSpendAllowanceItem.kt index b6be7f15e0..329402c6cd 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/approve/WcSpendAllowanceItem.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/approve/WcSpendAllowanceItem.kt @@ -1,5 +1,6 @@ package com.tangem.features.walletconnect.transaction.ui.approve +import androidx.compose.animation.AnimatedContent import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape @@ -12,8 +13,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import com.tangem.features.walletconnect.impl.R import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource import coil.compose.AsyncImage +import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.res.TangemTheme import com.tangem.features.walletconnect.transaction.entity.approve.WcSpendAllowanceUM import com.tangem.features.walletconnect.transaction.ui.common.WcSmallTitleItem @@ -52,11 +53,16 @@ internal fun WcSpendAllowanceItem(spendAllowance: WcSpendAllowanceUM, modifier: Spacer(modifier = Modifier.width(TangemTheme.dimens.spacing12)) - Text( - text = spendAllowance.amountText, - style = TangemTheme.typography.body1, - color = TangemTheme.colors.text.primary1, - ) + AnimatedContent( + targetState = spendAllowance.amountText, + label = "Animate Spend allowance text", + ) { amount -> + Text( + text = amount, + style = TangemTheme.typography.body1, + color = TangemTheme.colors.text.primary1, + ) + } } Row( @@ -64,7 +70,7 @@ internal fun WcSpendAllowanceItem(spendAllowance: WcSpendAllowanceUM, modifier: horizontalArrangement = Arrangement.End, ) { Text( - text = stringResource(R.string.manage_tokens_edit), + text = stringResourceSafe(R.string.manage_tokens_edit), style = TangemTheme.typography.body1, color = TangemTheme.colors.text.tertiary, ) diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/common/WcNetworkFeeItem.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/common/WcNetworkFeeItem.kt index bb4c1867c5..df6080b3e4 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/common/WcNetworkFeeItem.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/common/WcNetworkFeeItem.kt @@ -1,5 +1,6 @@ package com.tangem.features.walletconnect.transaction.ui.common +import androidx.compose.animation.AnimatedContent import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Icon @@ -48,11 +49,16 @@ internal fun WcNetworkFeeItem(networkFeeText: String, modifier: Modifier = Modif verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.End, ) { - Text( - text = networkFeeText, - style = TangemTheme.typography.body1, - color = TangemTheme.colors.text.tertiary, - ) + AnimatedContent( + targetState = networkFeeText, + label = "Animate Network fee text", + ) { fee -> + Text( + text = fee, + style = TangemTheme.typography.body1, + color = TangemTheme.colors.text.tertiary, + ) + } Spacer(modifier = Modifier.width(TangemTheme.dimens.spacing6)) Icon( modifier = Modifier diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/sign/WcSignTransactionModalBottomSheetContent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/sign/WcSignTransactionModalBottomSheetContent.kt index 838f9f4786..4596bcc2b6 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/sign/WcSignTransactionModalBottomSheetContent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/ui/sign/WcSignTransactionModalBottomSheetContent.kt @@ -38,11 +38,11 @@ internal fun WcSignTransactionModalBottomSheetContent( ) { Column( modifier = Modifier - .padding(horizontal = TangemTheme.dimens.spacing16), + .padding(horizontal = 16.dp), ) { Column( modifier = Modifier - .clip(RoundedCornerShape(TangemTheme.dimens.radius14)) + .clip(RoundedCornerShape(14.dp)) .background(color = TangemTheme.colors.background.action) .fillMaxWidth() .animateContentSize(), @@ -60,13 +60,13 @@ internal fun WcSignTransactionModalBottomSheetContent( modifier = Modifier .fillMaxWidth() .clickable { onClickTransactionRequest() } - .padding(TangemTheme.dimens.spacing12), + .padding(12.dp), ) } - Column(modifier = Modifier.padding(top = TangemTheme.dimens.spacing16)) { + Column(modifier = Modifier.padding(top = 16.dp)) { WcSignTransactionItems(state) WcTransactionRequestButtons( - modifier = Modifier.padding(vertical = TangemTheme.dimens.spacing16), + modifier = Modifier.padding(vertical = 16.dp), onDismiss = state.onDismiss, onClickActiveButton = state.onSign, activeButtonText = resourceReference(R.string.common_sign), @@ -80,27 +80,27 @@ internal fun WcSignTransactionModalBottomSheetContent( private fun WcSignTransactionItems(state: WcSignTransactionItemUM) { Column( modifier = Modifier - .clip(RoundedCornerShape(TangemTheme.dimens.radius14)) + .clip(RoundedCornerShape(14.dp)) .background(color = TangemTheme.colors.background.action) .fillMaxWidth() .animateContentSize(), ) { val itemsModifier = Modifier .fillMaxWidth() - .padding(TangemTheme.dimens.spacing12) + .padding(12.dp) DividerWithPadding(start = 0.dp, end = 0.dp) WcWalletItem( modifier = itemsModifier, walletName = state.walletName, ) - DividerWithPadding(start = TangemTheme.dimens.spacing40, end = TangemTheme.dimens.spacing12) + DividerWithPadding(start = 40.dp, end = 12.dp) WcNetworkItem( modifier = itemsModifier, networkInfo = state.networkInfo, ) if (!state.addressText.isNullOrEmpty()) { - DividerWithPadding(start = TangemTheme.dimens.spacing40, end = TangemTheme.dimens.spacing12) + DividerWithPadding(start = 40.dp, end = 12.dp) WcAddressItem( modifier = itemsModifier, addressText = state.addressText, @@ -116,7 +116,7 @@ internal fun DividerWithPadding(start: Dp, end: Dp) { start = start, end = end, ), - thickness = TangemTheme.dimens.size1, + thickness = 1.dp, color = TangemTheme.colors.stroke.primary, ) }