Skip to content

Commit 7af4342

Browse files
committed
fix/#40: TextButton이 fillMaxWidth인 경우 텍스트가 중앙 정렬 되지 않던 문제
1 parent e12c932 commit 7af4342

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

core/designsystem/src/main/java/com/yapp/core/designsystem/component/button/text/TextButtonBasic.kt

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,36 @@ fun YappTextButtonBasic(
4242
onClick: () -> Unit,
4343
) {
4444
CompositionLocalProvider(value = LocalRippleConfiguration provides colors.ripple) {
45-
Row(
45+
Box(
4646
modifier = modifier
4747
.clip(shape = shape)
4848
.yappClickable(
4949
runIf = enable,
5050
onClick = onClick,
51-
)
52-
.padding(contentPaddings)
53-
.heightIn(min = textStyle.lineHeight.value.dp),
54-
verticalAlignment = Alignment.CenterVertically,
51+
),
52+
contentAlignment = Alignment.Center
5553
) {
56-
if (leftIcon != null) {
57-
leftIcon()
58-
Spacer(Modifier.width(leftIconSpacing))
59-
}
54+
Row(
55+
modifier = Modifier
56+
.padding(contentPaddings)
57+
.heightIn(min = textStyle.lineHeight.value.dp),
58+
verticalAlignment = Alignment.CenterVertically,
59+
) {
60+
if (leftIcon != null) {
61+
leftIcon()
62+
Spacer(Modifier.width(leftIconSpacing))
63+
}
6064

61-
Text(
62-
text = text,
63-
style = textStyle,
64-
color = colors.textColor(enable = enable),
65-
)
65+
Text(
66+
text = text,
67+
style = textStyle,
68+
color = colors.textColor(enable = enable),
69+
)
6670

67-
if (rightIcon != null) {
68-
rightIcon()
69-
Spacer(Modifier.width(rightIconSpacing))
71+
if (rightIcon != null) {
72+
Spacer(Modifier.width(rightIconSpacing))
73+
rightIcon()
74+
}
7075
}
7176
}
7277
}

core/designsystem/src/main/java/com/yapp/core/designsystem/component/button/text/TextPrimaryButton.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fun YappTextPrimaryButtonSmall(
8686

8787
@Preview(showBackground = true)
8888
@Composable
89-
fun YappTextPrimaryButtonMediumPreview() {
89+
private fun YappTextPrimaryButtonMediumPreview() {
9090
YappTheme {
9191
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
9292
YappTextPrimaryButtonMedium(
@@ -105,7 +105,7 @@ fun YappTextPrimaryButtonMediumPreview() {
105105

106106
@Preview(showBackground = true)
107107
@Composable
108-
fun YappTextPrimaryButtonSmallPreview() {
108+
private fun YappTextPrimaryButtonSmallPreview() {
109109
YappTheme {
110110
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
111111
YappTextPrimaryButtonSmall(

0 commit comments

Comments
 (0)