Updated on 2026-08-14
This commit is contained in:
parent
5a09e48a53
commit
e7f862423d
11 changed files with 52 additions and 16 deletions
|
|
@ -62,6 +62,7 @@ private fun getTextColorByType(type: AuditLabelUM.Type): Color {
|
|||
AuditLabelUM.Type.Warning -> TangemTheme.colors.text.attention
|
||||
AuditLabelUM.Type.Permit -> TangemTheme.colors.text.accent
|
||||
AuditLabelUM.Type.Info -> TangemTheme.colors.text.primary2
|
||||
AuditLabelUM.Type.General -> TangemTheme.colors.text.secondary
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,6 +74,7 @@ private fun getBackgroundColorByType(type: AuditLabelUM.Type): Color {
|
|||
AuditLabelUM.Type.Warning -> TangemTheme.colors.text.attention.copy(alpha = 0.1f)
|
||||
AuditLabelUM.Type.Permit -> TangemTheme.colors.text.accent.copy(alpha = 0.1f)
|
||||
AuditLabelUM.Type.Info -> TangemTheme.colors.text.accent
|
||||
AuditLabelUM.Type.General -> TangemTheme.colors.control.default
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +85,7 @@ private fun getPaddingByType(type: AuditLabelUM.Type): PaddingValues {
|
|||
AuditLabelUM.Type.Prohibition,
|
||||
AuditLabelUM.Type.Warning,
|
||||
AuditLabelUM.Type.Permit,
|
||||
AuditLabelUM.Type.General,
|
||||
-> PaddingValues(horizontal = 4.dp)
|
||||
AuditLabelUM.Type.Info -> PaddingValues(horizontal = 6.dp, vertical = 1.dp)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,5 +25,8 @@ data class AuditLabelUM(val text: TextReference, val type: Type) {
|
|||
|
||||
/** Blue with white text. Like, "best rate" */
|
||||
Info,
|
||||
|
||||
/** Gray. Like, "info" */
|
||||
General,
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) {
|
|||
val backgroundColor by animateColorAsState(
|
||||
targetValue = when (state.style) {
|
||||
LabelStyle.ACCENT -> TangemTheme.colors.text.accent.copy(alpha = 0.1f)
|
||||
LabelStyle.REGULAR -> TangemTheme.colors.control.unchecked
|
||||
LabelStyle.REGULAR -> TangemTheme.colors.control.default
|
||||
LabelStyle.WARNING -> TangemTheme.colors.text.warning.copy(alpha = 0.1f)
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ private fun YieldSupplyApyLabel(apy: TextReference?, isActive: Boolean, modifier
|
|||
color = if (isActive) {
|
||||
TangemTheme.colors.text.accent.copy(alpha = 0.1f)
|
||||
} else {
|
||||
TangemTheme.colors.control.unchecked
|
||||
TangemTheme.colors.control.default
|
||||
},
|
||||
shape = TangemTheme.shapes.roundedCornersSmall2,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ internal fun YieldSupplyPromoBanner(state: PromoBannerState.Content, modifier: M
|
|||
LaunchedEffect(state) {
|
||||
state.onPromoShown()
|
||||
}
|
||||
val bgColor = TangemTheme.colors.control.unchecked
|
||||
val bgColor = TangemTheme.colors.control.default
|
||||
Column(modifier = modifier) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -169,19 +169,19 @@ class TangemColors internal constructor(
|
|||
@Stable
|
||||
class Control internal constructor(
|
||||
checked: Color,
|
||||
unchecked: Color,
|
||||
default: Color,
|
||||
key: Color,
|
||||
) {
|
||||
var checked by mutableStateOf(checked)
|
||||
private set
|
||||
var unchecked by mutableStateOf(unchecked)
|
||||
var default by mutableStateOf(default)
|
||||
private set
|
||||
var key by mutableStateOf(key)
|
||||
private set
|
||||
|
||||
fun update(other: Control) {
|
||||
checked = other.checked
|
||||
unchecked = other.unchecked
|
||||
default = other.default
|
||||
key = other.key
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ internal fun lightThemeColors(redesign: Boolean = false): TangemColors {
|
|||
),
|
||||
control = TangemColors.Control(
|
||||
checked = TangemColorPalette.Dark6,
|
||||
unchecked = TangemColorPalette.Light2,
|
||||
default = TangemColorPalette.Light2,
|
||||
key = TangemColorPalette.White,
|
||||
),
|
||||
stroke = TangemColors.Stroke(
|
||||
|
|
@ -314,7 +314,7 @@ internal fun darkThemeColors(): TangemColors {
|
|||
),
|
||||
control = TangemColors.Control(
|
||||
checked = TangemColorPalette.Azure,
|
||||
unchecked = TangemColorPalette.Dark4,
|
||||
default = TangemColorPalette.Dark4,
|
||||
key = TangemColorPalette.White,
|
||||
),
|
||||
stroke = TangemColors.Stroke(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue