Skip to content

Commit 8d6a75e

Browse files
committed
Use semantics colors.
1 parent 555beb1 commit 8d6a75e

File tree

1 file changed

+3
-20
lines changed
  • libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms

1 file changed

+3
-20
lines changed

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/BetaLabel.kt

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,31 @@ import androidx.compose.foundation.shape.RoundedCornerShape
1414
import androidx.compose.runtime.Composable
1515
import androidx.compose.ui.Modifier
1616
import androidx.compose.ui.unit.dp
17-
import io.element.android.compound.annotations.CoreColorToken
1817
import io.element.android.compound.theme.ElementTheme
19-
import io.element.android.compound.tokens.generated.internal.DarkColorTokens
20-
import io.element.android.compound.tokens.generated.internal.LightColorTokens
2118
import io.element.android.libraries.designsystem.preview.ElementPreview
2219
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
2320
import io.element.android.libraries.designsystem.theme.components.Text
2421

25-
@OptIn(CoreColorToken::class)
2622
@Composable
2723
fun BetaLabel(
2824
modifier: Modifier = Modifier,
2925
) {
30-
val (backgroundColor, borderColor, textColor) = if (ElementTheme.isLightTheme) {
31-
listOf(
32-
LightColorTokens.colorGreen300,
33-
LightColorTokens.colorGreen700,
34-
LightColorTokens.colorGreen900,
35-
)
36-
} else {
37-
listOf(
38-
DarkColorTokens.colorGreen300,
39-
DarkColorTokens.colorGreen700,
40-
DarkColorTokens.colorGreen900,
41-
)
42-
}
4326
val shape = RoundedCornerShape(size = 6.dp)
4427
Text(
4528
modifier = modifier
4629
.border(
4730
width = 1.dp,
48-
color = borderColor,
31+
color = ElementTheme.colors.borderInfoSubtle,
4932
shape = shape,
5033
)
5134
.background(
52-
color = backgroundColor,
35+
color = ElementTheme.colors.bgInfoSubtle,
5336
shape = shape,
5437
)
5538
.padding(horizontal = 8.dp, vertical = 4.dp),
5639
text = "BETA",
5740
style = ElementTheme.typography.fontBodySmMedium,
58-
color = textColor,
41+
color = ElementTheme.colors.textInfoPrimary,
5942
)
6043
}
6144

0 commit comments

Comments
 (0)