-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TNT-185] feat: 마이페이지 하얀 버튼 core:ui 컴포넌트로 분리
- Loading branch information
1 parent
23ffad1
commit 046a5b5
Showing
2 changed files
with
64 additions
and
40 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
core/ui/src/main/java/co/kr/tnt/ui/component/TnTMyPageButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package co.kr.tnt.ui.component | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.defaultMinSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonColors | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import co.kr.tnt.designsystem.theme.TnTTheme | ||
|
||
@Composable | ||
fun TnTMyPageButton( | ||
text: String, | ||
height: Dp, | ||
modifier: Modifier = Modifier, | ||
onClick: () -> Unit, | ||
) { | ||
Button( | ||
onClick = onClick, | ||
shape = RoundedCornerShape(12.dp), | ||
colors = ButtonColors( | ||
containerColor = TnTTheme.colors.commonColors.Common0, | ||
contentColor = TnTTheme.colors.neutralColors.Neutral700, | ||
disabledContainerColor = TnTTheme.colors.commonColors.Common0, | ||
disabledContentColor = TnTTheme.colors.neutralColors.Neutral700, | ||
), | ||
contentPadding = PaddingValues(horizontal = 20.dp, vertical = 12.dp), | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.height(height) | ||
.defaultMinSize(minWidth = Dp.Hairline), | ||
) { | ||
Text( | ||
text = text, | ||
style = TnTTheme.typography.body2Medium, | ||
modifier = Modifier.fillMaxWidth(), | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun TnTMyPageButtonPreview() { | ||
TnTTheme { | ||
TnTMyPageButton( | ||
text = "트레이너와 연결하기", | ||
height = 47.dp, | ||
onClick = {}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters