From 0ac0ac2aad48f2672404f00a05db67ca2f2c3ce4 Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 6 Oct 2023 12:36:30 +0200 Subject: [PATCH] add light text button style --- .../hisp/dhis/mobile/ui/designsystem/component/Button.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Button.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Button.kt index e66448630..135144953 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Button.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/Button.kt @@ -83,8 +83,12 @@ fun Button( paddingValues = paddingValues, ) } - ButtonStyle.TEXT -> { - val textColor = if (enabled) SurfaceColor.Primary else TextColor.OnDisabledSurface + ButtonStyle.TEXT, ButtonStyle.TEXT_LIGHT -> { + val textColor = when { + !enabled -> TextColor.OnDisabledSurface + style == ButtonStyle.TEXT_LIGHT -> TextColor.OnPrimary + else -> SurfaceColor.Primary + } CompositionLocalProvider(LocalRippleTheme provides Ripple.CustomDHISRippleTheme) { OutlinedButton( modifier = modifier, @@ -311,6 +315,7 @@ enum class ButtonStyle { FILLED, OUTLINED, TEXT, + TEXT_LIGHT, ELEVATED, TONAL, KEYBOARDKEY,