Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-18 12:36:46 +05:00
parent 26201c5c0b
commit 0be1358760
39 changed files with 581 additions and 124 deletions

View file

@ -4,6 +4,7 @@ import android.content.res.Configuration
import androidx.annotation.DrawableRes
import coil.compose.SubcomposeAsyncImage
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.clickable
@ -28,6 +29,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.tangem.core.ui.R
import com.tangem.core.ui.components.*
import com.tangem.core.ui.components.buttons.common.TangemButtonSize
@ -61,6 +63,7 @@ fun Notification(
titleColor: Color = TangemTheme.colors.text.primary1,
subtitleColor: Color = TangemTheme.colors.text.tertiary,
containerColor: Color? = null,
borderColor: Color? = null,
iconTint: Color? = when (config.iconTint) {
NotificationConfig.IconTint.Unspecified -> null
NotificationConfig.IconTint.Accent -> TangemTheme.colors.icon.accent
@ -75,6 +78,7 @@ fun Notification(
onCloseClick = config.onCloseClick,
modifier = modifier,
containerColor = containerColor,
borderColor = borderColor,
isEnabled = isEnabled,
) {
MainContent(
@ -100,6 +104,7 @@ internal fun NotificationBaseContainer(
modifier: Modifier = Modifier,
isEnabled: Boolean = true,
containerColor: Color? = null,
borderColor: Color? = null,
content: @Composable ColumnScope.() -> Unit,
) {
val tempContainerColor by rememberUpdatedState(
@ -118,6 +123,7 @@ internal fun NotificationBaseContainer(
enabled = onClick != null && isEnabled,
shape = TangemTheme.shapes.roundedCornersXMedium,
color = containerColor ?: tempContainerColor,
border = borderColor?.let { BorderStroke(width = 1.dp, color = it) },
) {
Box {
Column(

View file

@ -79,6 +79,24 @@ object Dialogs {
)
}
/**
* Dialog shown when adding funds (buy / receive / swap) is blocked because the wallet has a backup problem.
* Centralizes the wording and button behavior reused across wallet actions, token details, markets and swap.
*
* @param onContactSupport lambda invoked when the "Contact support" action is clicked
*/
fun backupErrorAddFundsDisabled(onContactSupport: () -> Unit): DialogMessage = DialogMessage(
title = resourceReference(R.string.warning_backup_error_add_funds_title),
message = resourceReference(R.string.warning_backup_error_add_funds_message),
firstActionBuilder = {
EventMessageAction(
title = resourceReference(R.string.common_contact_support),
onClick = onContactSupport,
)
},
secondActionBuilder = { cancelAction() },
)
/**
* Universal error dialog
*/

View file

@ -72,6 +72,7 @@ object TangemColorPalette {
// region Amaranth
val Amaranth = Color(0xFFFF3333)
val Amaranth_50 = Color(0x80FF3333)
val Amaranth_30 = Color(0x4DFF3333)
val Amaranth_20 = Color(0x33FF3333)
val Amaranth_10 = Color(0x1AFF3333)
// endregion Amaranth