From 6e1a91307dfadc454520d360c4fce3248f070b11 Mon Sep 17 00:00:00 2001 From: Jung SeokJoon Date: Thu, 1 Aug 2024 23:55:19 +0900 Subject: [PATCH] =?UTF-8?q?implement=20Button=20-=20enabled=20=ED=8C=8C?= =?UTF-8?q?=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mission_mate/core/designsystem/component/Button.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/designsystem/src/main/java/com/goalpanzi/mission_mate/core/designsystem/component/Button.kt b/core/designsystem/src/main/java/com/goalpanzi/mission_mate/core/designsystem/component/Button.kt index e50a18a9..fabe6d7c 100644 --- a/core/designsystem/src/main/java/com/goalpanzi/mission_mate/core/designsystem/component/Button.kt +++ b/core/designsystem/src/main/java/com/goalpanzi/mission_mate/core/designsystem/component/Button.kt @@ -38,13 +38,11 @@ fun MissionMateTextButton( modifier: Modifier = Modifier, buttonType: MissionMateButtonType = MissionMateButtonType.ACTIVE, textColor: Color = Color(0xFFFFFFFF), - textStyle: TextStyle = MissionMateTypography.body_lg_bold, - enabled: Boolean = true + textStyle: TextStyle = MissionMateTypography.body_lg_bold ) { MissionMateButton( modifier = modifier, buttonType = buttonType, - enabled = enabled, onClick = onClick ) { Text( @@ -60,14 +58,13 @@ fun MissionMateButton( onClick: () -> Unit, modifier: Modifier = Modifier, buttonType: MissionMateButtonType = MissionMateButtonType.ACTIVE, - enabled: Boolean = true, shape: Shape = RoundedCornerShape(30.dp), contentPadding: PaddingValues = PaddingValues(vertical = 18.dp, horizontal = 30.dp), content: @Composable () -> Unit ) { Button( modifier = modifier, - enabled = enabled, + enabled = buttonType != MissionMateButtonType.DISABLED, shape = shape, colors = ButtonColors( containerColor = buttonType.containerColor, @@ -110,7 +107,7 @@ fun PreviewTextButtonDisabled(){ MissionMateTextButton( modifier = Modifier.fillMaxWidth(), textId = R.string.app_name, - enabled = false, + buttonType = MissionMateButtonType.DISABLED, onClick = {} ) } \ No newline at end of file