diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/RectangleButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/RectangleButton.kt index 0b4a942e8..d5ad56bbf 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/RectangleButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/RectangleButton.kt @@ -13,6 +13,7 @@ import com.terning.core.designsystem.theme.TerningTheme @Composable fun RectangleButton( modifier: Modifier = Modifier, + isEnabled: Boolean = true, text: String = "", style: TextStyle, paddingVertical: Dp, @@ -20,6 +21,7 @@ fun RectangleButton( ) { TerningBasicButton( modifier = modifier, + isEnabled = isEnabled, shape = RoundedCornerShape(0.dp), onButtonClick = onButtonClick, text = text, diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/RoundButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/RoundButton.kt index 3b66bc3ef..ccf43e196 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/RoundButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/RoundButton.kt @@ -13,6 +13,7 @@ import com.terning.core.designsystem.theme.TerningTheme @Composable fun RoundButton( modifier: Modifier = Modifier, + isEnabled: Boolean = true, text: String = "", style: TextStyle, paddingVertical: Dp, @@ -21,6 +22,7 @@ fun RoundButton( ) { TerningBasicButton( modifier = modifier, + isEnabled = isEnabled, shape = RoundedCornerShape(roundedCornerShape), onButtonClick = onButtonClick, text = text, diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt index 5d451e962..ae050648e 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/TerningBasicButton.kt @@ -18,6 +18,8 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningMain2 import com.terning.core.designsystem.theme.TerningPointTheme @@ -28,6 +30,7 @@ import com.terning.core.util.NoRippleTheme @Composable fun TerningBasicButton( modifier: Modifier = Modifier, + isEnabled: Boolean = true, text: String = "", shape: Shape, style: TextStyle, @@ -36,15 +39,18 @@ fun TerningBasicButton( ) { val interactionSource = remember { MutableInteractionSource() } val isPressed by interactionSource.collectIsPressedAsState() - val color = if (isPressed) TerningMain2 else TerningMain + val backgroundColor = if (isPressed) TerningMain2 else TerningMain CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { Button( modifier = modifier.fillMaxWidth(), interactionSource = interactionSource, + enabled = isEnabled, colors = ButtonDefaults.buttonColors( - containerColor = color, - contentColor = White + containerColor = backgroundColor, + contentColor = White, + disabledContainerColor = Grey150, + disabledContentColor = Black ), shape = shape, onClick = { onButtonClick() }