Updated on 2026-08-14
This commit is contained in:
parent
aa05aafc8b
commit
06d083b283
8 changed files with 35 additions and 33 deletions
|
|
@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.common.ui.amountScreen.models.AmountState
|
||||
import com.tangem.common.ui.amountScreen.preview.AmountStatePreviewData
|
||||
import com.tangem.core.ui.components.ResizableText
|
||||
import com.tangem.core.ui.components.SpacerWMax
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIcon
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIconState
|
||||
|
|
@ -24,6 +25,7 @@ import com.tangem.core.ui.extensions.resolveReference
|
|||
import com.tangem.core.ui.format.bigdecimal.crypto
|
||||
import com.tangem.core.ui.format.bigdecimal.fiat
|
||||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.core.ui.format.bigdecimal.uncapped
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
||||
|
|
@ -43,7 +45,7 @@ fun AmountBlockV2(
|
|||
crypto(
|
||||
symbol = "",
|
||||
decimals = amount.cryptoAmount.decimals,
|
||||
)
|
||||
).uncapped()
|
||||
}.orEmpty()
|
||||
|
||||
val fiatAmount = amount.fiatAmount.value.format {
|
||||
|
|
@ -102,7 +104,7 @@ private fun AmountBlockV2(
|
|||
Row {
|
||||
Text(
|
||||
text = title.resolveReference(),
|
||||
style = TangemTheme.typography.body2,
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
SpacerWMax()
|
||||
|
|
@ -121,18 +123,20 @@ private fun AmountBlockV2(
|
|||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
) {
|
||||
Text(
|
||||
ResizableText(
|
||||
text = firstAmount,
|
||||
style = TangemTheme.typography.h2,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
maxLines = 1,
|
||||
)
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
Text(
|
||||
ResizableText(
|
||||
text = secondAmount,
|
||||
style = TangemTheme.typography.body2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
maxLines = 1,
|
||||
)
|
||||
extraContent()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ internal class DefaultChooseManagedTokensComponent @AssistedInject constructor(
|
|||
cryptoCurrency = cryptoCurrency,
|
||||
shouldResetNavigation = params.selectedCurrency != null,
|
||||
)
|
||||
model.bottomSheetNavigation.dismiss()
|
||||
params.callback?.onResult() ?: router.pop()
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ package com.tangem.features.send.v2.subcomponents.amount.model
|
|||
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.ui.UiMessageSender
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.message.DialogMessage
|
||||
import com.tangem.core.ui.message.EventMessageAction
|
||||
import com.tangem.features.send.v2.impl.R
|
||||
import javax.inject.Inject
|
||||
|
||||
@ModelScoped
|
||||
|
|
@ -13,20 +14,19 @@ internal class SendAmountAlertFactory @Inject constructor(
|
|||
) {
|
||||
|
||||
fun showResetSendingAlert(onConfirm: () -> Unit) {
|
||||
// todo fix localization [REDACTED_TASK_KEY]
|
||||
uiMessageSender.send(
|
||||
DialogMessage(
|
||||
title = stringReference("Confirm Convert"),
|
||||
message = stringReference("Proceed with conversion? Previous data will be reset."),
|
||||
title = resourceReference(R.string.send_with_swap_convert_token_alert_title),
|
||||
message = resourceReference(R.string.send_with_swap_convert_token_alert_message),
|
||||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Confirm"),
|
||||
title = resourceReference(R.string.common_confirm),
|
||||
onClick = onConfirm,
|
||||
)
|
||||
},
|
||||
secondActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Not Now"),
|
||||
title = resourceReference(R.string.common_not_now),
|
||||
onClick = onDismissRequest,
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
import com.tangem.core.ui.components.icons.identicon.IdentIcon
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
|
@ -62,7 +63,7 @@ private fun AddressBlock(address: DestinationTextFieldUM.RecipientAddress) {
|
|||
Text(
|
||||
text = address.label.resolveReference(),
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
|
@ -104,7 +105,7 @@ private fun MemoBlock(memo: DestinationTextFieldUM.RecipientMemo?) {
|
|||
Text(
|
||||
text = memo.label.resolveReference(),
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
Text(
|
||||
text = memo.value,
|
||||
|
|
@ -121,7 +122,7 @@ private fun AddressWithMemoBlock(
|
|||
memo: DestinationTextFieldUM.RecipientMemo?,
|
||||
) {
|
||||
Text(
|
||||
text = stringResourceSafe(R.string.send_to_address),
|
||||
text = stringResourceSafe(R.string.send_recipient),
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
|
|
@ -188,7 +189,7 @@ private class DestinationBlockPreviewProvider : PreviewParameterProvider<Destina
|
|||
value = "0x34B4492A412D84A6E606288f3Bd714b89135D4dE",
|
||||
keyboardOptions = KeyboardOptions.Default,
|
||||
placeholder = TextReference.Str("Enter address"),
|
||||
label = TextReference.Str("Recipient Address"),
|
||||
label = resourceReference(R.string.send_recipient),
|
||||
isError = false,
|
||||
error = null,
|
||||
isValuePasted = false,
|
||||
|
|
|
|||
|
|
@ -64,22 +64,19 @@ internal class SwapAmountAlertFactory @Inject constructor(
|
|||
}
|
||||
|
||||
fun showCloseSendWithSwapAlert(onConfirm: () -> Unit) {
|
||||
// todo fix localization [REDACTED_TASK_KEY]
|
||||
uiMessageSender.send(
|
||||
DialogMessage(
|
||||
title = stringReference("Confirm cancellation"),
|
||||
message = stringReference(
|
||||
"Are you sure you want to cancel the conversion? After changing, previous data will be reset.",
|
||||
),
|
||||
title = resourceReference(R.string.send_with_swap_remove_convert_alert_title),
|
||||
message = resourceReference(R.string.send_with_swap_remove_convert_alert_message),
|
||||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Confirm"),
|
||||
title = resourceReference(R.string.common_confirm),
|
||||
onClick = onConfirm,
|
||||
)
|
||||
},
|
||||
secondActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Not Now"),
|
||||
title = resourceReference(R.string.common_not_now),
|
||||
onClick = onDismissRequest,
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ internal class SwapAmountModel @Inject constructor(
|
|||
).onEach { (state, route) ->
|
||||
params.callback.onNavigationResult(
|
||||
NavigationUM.Content(
|
||||
title = resourceReference(R.string.common_swap),
|
||||
title = resourceReference(R.string.common_amount),
|
||||
subtitle = null,
|
||||
backIconRes = if (route.isEditMode) {
|
||||
R.drawable.ic_back_24
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model
|
|||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.ui.UiMessageSender
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.message.DialogMessage
|
||||
import com.tangem.core.ui.message.EventMessageAction
|
||||
import com.tangem.features.swap.v2.impl.R
|
||||
|
|
@ -26,22 +25,19 @@ internal class SwapChooseTokenAlertFactory @Inject constructor(
|
|||
}
|
||||
|
||||
fun showChangeTokenAlert(onConfirm: () -> Unit, onDismiss: () -> Unit) {
|
||||
// todo fix localization [REDACTED_TASK_KEY]
|
||||
uiMessageSender.send(
|
||||
DialogMessage(
|
||||
title = stringReference("Changing token"),
|
||||
message = stringReference(
|
||||
"Are you sure you want to change the token? After changing, previous data will be reset.",
|
||||
),
|
||||
title = resourceReference(R.string.send_with_swap_change_token_alert_title),
|
||||
message = resourceReference(R.string.send_with_swap_change_token_alert_message),
|
||||
firstActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Change"),
|
||||
title = resourceReference(R.string.common_change),
|
||||
onClick = onConfirm,
|
||||
)
|
||||
},
|
||||
secondActionBuilder = {
|
||||
EventMessageAction(
|
||||
title = stringReference("Cancel"),
|
||||
title = resourceReference(R.string.common_cancel),
|
||||
onClick = onDismiss,
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -125,9 +125,12 @@ internal fun SendWithSwapSuccessContent(sendWithSwapUM: SendWithSwapUM) {
|
|||
),
|
||||
),
|
||||
)
|
||||
.padding(top = 24.dp)
|
||||
.padding(horizontal = 16.dp),
|
||||
|
||||
.padding(
|
||||
top = 24.dp,
|
||||
bottom = 12.dp,
|
||||
start = 16.dp,
|
||||
end = 16.dp,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue