Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-14 12:31:09 +05:00
commit e7d32b3e0f
5 changed files with 88 additions and 51 deletions

View file

@ -179,6 +179,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicModalBottomSheet(
onBack = onBack,
dragHandle = null,
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
} else {
ModalBottomSheet(
@ -190,6 +191,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicModalBottomSheet(
contentWindowInsets = { WindowInsetsZero },
dragHandle = null,
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
}
}
@ -200,58 +202,62 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicModalBottomSheet(
@Composable
private fun TangemModalBottomSheet_Preview() {
TangemThemePreview {
TangemModalBottomSheet<TangemBottomSheetConfigContentPreviewConfig>(
config = TangemBottomSheetConfig(
isShown = true,
onDismissRequest = {},
content = TangemBottomSheetConfigContentPreviewConfig(),
),
title = {
TangemModalBottomSheetTitle(
endIconRes = R.drawable.ic_close_24,
onEndClick = {},
)
},
content = {
Column(
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
modifier = Modifier
.size(56.dp)
.clip(RoundedCornerShape(100))
.background(TangemTheme.colors.icon.informative.copy(alpha = 0.1f))
.padding(12.dp),
painter = rememberVectorPainter(
ImageVector.vectorResource(R.drawable.ic_alert_24),
),
tint = TangemTheme.colors.icon.informative,
contentDescription = null,
Box(
Modifier.background(TangemTheme.colors.background.tertiary),
) {
TangemModalBottomSheet<TangemBottomSheetConfigContentPreviewConfig>(
config = TangemBottomSheetConfig(
isShown = true,
onDismissRequest = {},
content = TangemBottomSheetConfigContentPreviewConfig(),
),
title = {
TangemModalBottomSheetTitle(
endIconRes = R.drawable.ic_close_24,
onEndClick = {},
)
SpacerH24()
Text(
text = "Unsuported networks",
style = TangemTheme.typography.h3,
color = TangemTheme.colors.text.primary1,
textAlign = TextAlign.Center,
)
SpacerH8()
Text(
text = "Tangem does not currently support a required network by React App.",
style = TangemTheme.typography.body2,
color = TangemTheme.colors.text.secondary,
textAlign = TextAlign.Center,
)
SpacerH(48.dp)
PrimaryButton(
modifier = Modifier.fillMaxWidth(),
text = "Go it",
onClick = {},
)
}
},
)
},
content = {
Column(
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
modifier = Modifier
.size(56.dp)
.clip(RoundedCornerShape(100))
.background(TangemTheme.colors.icon.informative.copy(alpha = 0.1f))
.padding(12.dp),
painter = rememberVectorPainter(
ImageVector.vectorResource(R.drawable.ic_alert_24),
),
tint = TangemTheme.colors.icon.informative,
contentDescription = null,
)
SpacerH24()
Text(
text = "Unsuported networks",
style = TangemTheme.typography.h3,
color = TangemTheme.colors.text.primary1,
textAlign = TextAlign.Center,
)
SpacerH8()
Text(
text = "Tangem does not currently support a required network by React App.",
style = TangemTheme.typography.body2,
color = TangemTheme.colors.text.secondary,
textAlign = TextAlign.Center,
)
SpacerH(48.dp)
PrimaryButton(
modifier = Modifier.fillMaxWidth(),
text = "Go it",
onClick = {},
)
}
},
)
}
}
}

View file

@ -235,6 +235,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicModalBottomSheetWit
onBack = onBack,
dragHandle = null,
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
} else {
ModalBottomSheet(
@ -246,6 +247,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicModalBottomSheetWit
contentWindowInsets = { WindowInsetsZero },
dragHandle = null,
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
}
}

View file

@ -192,6 +192,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicBottomSheet(
dragHandle = { TangemBottomSheetDraggableHeader(color = containerColor) },
onBack = onBack,
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
} else {
ModalBottomSheet(
@ -203,6 +204,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicBottomSheet(
contentWindowInsets = { WindowInsetsZero },
dragHandle = { TangemBottomSheetDraggableHeader(color = containerColor) },
content = bsContent,
scrimColor = TangemTheme.colors.overlay.secondary,
)
}
}

View file

@ -16,6 +16,7 @@ class TangemColors internal constructor(
control: Control,
stroke: Stroke,
field: Field,
overlay: Overlay,
) {
var text by mutableStateOf(text)
private set
@ -31,6 +32,7 @@ class TangemColors internal constructor(
private set
var field by mutableStateOf(field)
private set
var overlay by mutableStateOf(overlay)
@Stable
class Text internal constructor(
@ -220,6 +222,22 @@ class TangemColors internal constructor(
}
}
@Stable
class Overlay internal constructor(
primary: Color,
secondary: Color,
) {
var primary by mutableStateOf(primary)
private set
var secondary by mutableStateOf(secondary)
private set
fun update(other: Overlay) {
primary = other.primary
secondary = other.secondary
}
}
fun update(other: TangemColors) {
text.update(other.text)
icon.update(other.icon)
@ -228,5 +246,6 @@ class TangemColors internal constructor(
control.update(other.control)
stroke.update(other.stroke)
field.update(other.field)
overlay.update(other.overlay)
}
}

View file

@ -238,6 +238,10 @@ private fun lightThemeColors(): TangemColors {
primary = TangemColorPalette.Light1,
focused = TangemColorPalette.Light2,
),
overlay = TangemColors.Overlay(
primary = TangemColorPalette.Black.copy(alpha = 0.4f),
secondary = TangemColorPalette.Black.copy(alpha = 0.7f),
),
)
}
@ -288,6 +292,10 @@ private fun darkThemeColors(): TangemColors {
primary = TangemColorPalette.Dark5,
focused = TangemColorPalette.Dark4,
),
overlay = TangemColors.Overlay(
primary = TangemColorPalette.Black.copy(alpha = 0.4f),
secondary = TangemColorPalette.Black.copy(alpha = 0.7f),
),
)
}