Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-16 12:58:48 +05:00
parent 16a83cf56d
commit 9fb5124c38
30 changed files with 528 additions and 801 deletions

View file

@ -4,7 +4,7 @@ import androidx.annotation.DrawableRes
import androidx.compose.runtime.Immutable
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent
import com.tangem.core.ui.components.bottomsheets.message.MessageBottomSheetUMV2
import com.tangem.core.ui.components.bottomsheets.message.MessageBottomSheetUM
import com.tangem.core.ui.extensions.TextReference
import kotlinx.collections.immutable.ImmutableList
@ -15,18 +15,18 @@ internal data class SwapChooseTokenNetworkUM(
@Immutable
internal sealed class SwapChooseTokenNetworkContentUM : TangemBottomSheetConfigContent {
abstract val messageContent: MessageBottomSheetUMV2
abstract val messageContent: MessageBottomSheetUM
data class Loading(
override val messageContent: MessageBottomSheetUMV2,
override val messageContent: MessageBottomSheetUM,
) : SwapChooseTokenNetworkContentUM()
data class Error(
override val messageContent: MessageBottomSheetUMV2,
override val messageContent: MessageBottomSheetUM,
) : SwapChooseTokenNetworkContentUM()
data class Content(
override val messageContent: MessageBottomSheetUMV2,
override val messageContent: MessageBottomSheetUM,
val swapNetworks: ImmutableList<SwapChooseNetworkUM>,
) : SwapChooseTokenNetworkContentUM()
}

View file

@ -7,12 +7,12 @@ import com.tangem.features.swap.v2.impl.R
internal object SwapChooseTokenFactory {
fun getErrorMessage(tokenName: String, onDismiss: () -> Unit): MessageBottomSheetUMV2 {
fun getErrorMessage(tokenName: String, onDismiss: () -> Unit): MessageBottomSheetUM {
return messageBottomSheetUM {
infoBlock {
icon(R.drawable.ic_alert_triangle_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
}
title = resourceReference(R.string.express_swap_not_supported_title, wrappedList(tokenName))
body = resourceReference(R.string.express_swap_not_supported_text)

View file

@ -73,7 +73,7 @@ internal fun SwapChooseTokenNetworkContent(state: SwapChooseTokenNetworkContentU
is SwapChooseTokenNetworkContentUM.Content -> SwapChooseTokenNetworkContentList(targetState.swapNetworks)
else -> {
Box {
MessageBottomSheetV2Content(
MessageBottomSheetContent(
state = targetState.messageContent,
modifier = Modifier
.conditional(targetState is SwapChooseTokenNetworkContentUM.Loading) {
@ -180,8 +180,8 @@ private class PreviewProvider : PreviewParameterProvider<SwapChooseTokenNetworkC
messageContent = messageBottomSheetUM {
infoBlock {
icon(R.drawable.ic_alert_triangle_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.Unspecified
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.Unspecified
}
title = stringReference("Shiba Inu is not suppoerted")
body = stringReference("This token is not supported. Please choose a different token to swap.")
@ -196,8 +196,8 @@ private class PreviewProvider : PreviewParameterProvider<SwapChooseTokenNetworkC
messageContent = messageBottomSheetUM {
infoBlock {
icon(R.drawable.ic_alert_triangle_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
}
title = stringReference("Shiba Inu is not supported")
body = stringReference("This token is not supported. Please choose a different token to swap.")
@ -212,8 +212,8 @@ private class PreviewProvider : PreviewParameterProvider<SwapChooseTokenNetworkC
messageContent = messageBottomSheetUM {
infoBlock {
icon(R.drawable.img_attention_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
}
title = stringReference("Shiba Inu is not suppoerted")
body = stringReference("This token is not supported. Please choose a different token to swap.")
@ -238,8 +238,8 @@ private class PreviewProvider : PreviewParameterProvider<SwapChooseTokenNetworkC
messageContent = messageBottomSheetUM {
infoBlock {
icon(R.drawable.img_attention_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
}
title = stringReference("Shiba Inu is not suppoerted")
body = stringReference("This token is not supported. Please choose a different token to swap.")
@ -288,8 +288,8 @@ private class PreviewProvider : PreviewParameterProvider<SwapChooseTokenNetworkC
messageContent = messageBottomSheetUM {
infoBlock {
icon(R.drawable.img_attention_20) {
type = MessageBottomSheetUMV2.Icon.Type.Attention
backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint
type = MessageBottomSheetUM.Icon.Type.Attention
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
}
title = stringReference("Shiba Inu is not suppoerted")
body = stringReference("This token is not supported. Please choose a different token to swap.")