Updated on 2026-08-14
This commit is contained in:
parent
154308b973
commit
e51453c99b
15 changed files with 173 additions and 68 deletions
|
|
@ -64,6 +64,10 @@
|
|||
<string name="auth_info_add_wallet_title">Add Wallet</string>
|
||||
<string name="auth_info_subtitle">Select a wallet to log in</string>
|
||||
<string name="auth_info_title">Welcome back!</string>
|
||||
<plurals name="auth_wallet_hardware_description">
|
||||
<item quantity="one">%d card</item>
|
||||
<item quantity="other">%d cards</item>
|
||||
</plurals>
|
||||
<string name="auth_wallet_mobile_description">Phone Wallet</string>
|
||||
<string name="backup_complete_description">You successfully backed up your wallet.</string>
|
||||
<string name="backup_complete_seed_description">These words can’t be recovered if lost. Make sure to keep it somewhere secure.</string>
|
||||
|
|
@ -866,6 +870,7 @@
|
|||
<string name="send_date_format">%1$s, %2$s</string>
|
||||
<string name="send_destination_tag_field">Destination Tag</string>
|
||||
<string name="send_enter_address_field">Enter address</string>
|
||||
<string name="send_enter_address_field_ens">Enter ENS name or address</string>
|
||||
<string name="send_error_address_same_as_wallet">Address is the same as wallet address</string>
|
||||
<string name="send_error_dust_amount_format">Minimum amount is %s</string>
|
||||
<string name="send_error_dust_change_format">Minimum change is %s</string>
|
||||
|
|
@ -947,11 +952,15 @@
|
|||
<string name="send_validation_invalid_amount">Invalid amount</string>
|
||||
<string name="send_validation_invalid_fee">Fee exceeds balance</string>
|
||||
<string name="send_validation_invalid_total">Total amount exceeds balance</string>
|
||||
<string name="send_with_swap_change_token_alert_message">Are you sure you want to change the token? After changing, previous data will be reset.</string>
|
||||
<string name="send_with_swap_change_token_alert_title">Changing token</string>
|
||||
<string name="send_with_swap_confirm_title">Swap and send</string>
|
||||
<string name="send_with_swap_notification_text">Send any token, and we’ll convert it on the way. Your recipient gets exactly what they need—seamlessly.</string>
|
||||
<string name="send_with_swap_recipient_amount_success_title">Recipient will receive</string>
|
||||
<string name="send_with_swap_recipient_amount_text">Will be sent a recipient</string>
|
||||
<string name="send_with_swap_recipient_amount_title">Amount to receive</string>
|
||||
<string name="send_with_swap_remove_convert_alert_message">Are you sure you want to cancel the conversion? After changing, previous data will be reset.</string>
|
||||
<string name="send_with_swap_remove_convert_alert_title">Confirm cancelation</string>
|
||||
<string name="send_with_swap_title">Send with swap</string>
|
||||
<string name="sent_transaction_sent_title">Transaction sent</string>
|
||||
<string name="settings_card_settings_footer">Prepare to scan card or ring you want to set up.</string>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import androidx.compose.foundation.background
|
|||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment.Companion.CenterEnd
|
||||
|
|
@ -19,6 +20,7 @@ import androidx.compose.ui.draw.clip
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.buttons.small.TangemIconButton
|
||||
import com.tangem.core.ui.components.fields.SimpleTextField
|
||||
|
|
@ -69,6 +71,7 @@ fun InputRowRecipient(
|
|||
showDivider: Boolean = false,
|
||||
isLoading: Boolean = false,
|
||||
isValuePasted: Boolean = false,
|
||||
resolvedAddress: String? = null,
|
||||
) {
|
||||
val (titleText, color) = if (isError && error != null) {
|
||||
error to TangemTheme.colors.text.warning
|
||||
|
|
@ -144,11 +147,15 @@ fun InputRowRecipient(
|
|||
} else {
|
||||
TangemTheme.colors.text.primary2
|
||||
},
|
||||
modifier = Modifier
|
||||
.padding(start = TangemTheme.dimens.spacing8),
|
||||
modifier = Modifier.padding(start = TangemTheme.dimens.spacing8),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
ResolvedAddressRow(
|
||||
isLoading = isLoading,
|
||||
resolvedAddress = resolvedAddress,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -203,6 +210,38 @@ private fun RowScope.InputIcon(isLoading: Boolean, value: String) {
|
|||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ResolvedAddressRow(isLoading: Boolean, resolvedAddress: String?) {
|
||||
AnimatedContent(
|
||||
targetState = if (resolvedAddress.isNullOrBlank() || isLoading) {
|
||||
ResolvedState.Hide
|
||||
} else {
|
||||
ResolvedState.Show(resolvedAddress)
|
||||
},
|
||||
label = "Resolved Address",
|
||||
) { state ->
|
||||
if (state is ResolvedState.Show) {
|
||||
Column {
|
||||
HorizontalDivider(
|
||||
thickness = 0.5.dp,
|
||||
modifier = Modifier.padding(top = 12.dp, bottom = 12.dp),
|
||||
color = TangemTheme.colors.stroke.primary,
|
||||
)
|
||||
Text(
|
||||
text = state.address,
|
||||
style = TangemTheme.typography.caption2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private sealed interface ResolvedState {
|
||||
data object Hide : ResolvedState
|
||||
data class Show(val address: String) : ResolvedState
|
||||
}
|
||||
|
||||
//region preview
|
||||
@Preview
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
|
|
@ -224,6 +263,7 @@ private fun InputRowRecipientPreview(
|
|||
onQrCodeClick = {},
|
||||
modifier = Modifier.background(TangemTheme.colors.background.primary),
|
||||
isRedesignEnabled = false,
|
||||
resolvedAddress = value.resolvedAddress,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -232,6 +272,7 @@ private data class InputRowRecipientPreviewData(
|
|||
val value: String,
|
||||
val isError: Boolean,
|
||||
val isLoading: Boolean = false,
|
||||
val resolvedAddress: String? = null,
|
||||
)
|
||||
|
||||
private class InputRowRecipientPreviewDataProvider : PreviewParameterProvider<InputRowRecipientPreviewData> {
|
||||
|
|
@ -250,6 +291,12 @@ private class InputRowRecipientPreviewDataProvider : PreviewParameterProvider<In
|
|||
isLoading = true,
|
||||
isError = true,
|
||||
),
|
||||
InputRowRecipientPreviewData(
|
||||
value = "vitalik.eth",
|
||||
isLoading = false,
|
||||
isError = true,
|
||||
resolvedAddress = "0x391316d97a07027a0702c8A002c8A0C25d8470",
|
||||
),
|
||||
)
|
||||
}
|
||||
//endregion
|
||||
Loading…
Add table
Add a link
Reference in a new issue