Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 01e5f26

Browse files
committedJul 16, 2024
[design] #62 middle button
1 parent 1c9c5b2 commit 01e5f26

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package com.record.designsystem.component.button
2+
3+
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.PaddingValues
7+
import androidx.compose.foundation.layout.fillMaxWidth
8+
import androidx.compose.foundation.layout.padding
9+
import androidx.compose.foundation.layout.wrapContentWidth
10+
import androidx.compose.foundation.shape.RoundedCornerShape
11+
import androidx.compose.runtime.Composable
12+
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.graphics.Color
14+
import androidx.compose.ui.graphics.Color.Companion.White
15+
import androidx.compose.ui.graphics.Shape
16+
import androidx.compose.ui.text.TextStyle
17+
import androidx.compose.ui.tooling.preview.Preview
18+
import androidx.compose.ui.unit.Dp
19+
import androidx.compose.ui.unit.dp
20+
import com.record.designsystem.theme.Black
21+
import com.record.designsystem.theme.Main
22+
import com.record.designsystem.theme.RecordyTheme
23+
import timber.log.Timber
24+
25+
@Composable
26+
fun RecordyMiddleButton(
27+
modifier: Modifier = Modifier,
28+
text: String,
29+
textStyle: TextStyle = RecordyTheme.typography.button1,
30+
shape: Shape = RoundedCornerShape(6.dp),
31+
enabled: Boolean = true,
32+
clickable: Boolean = true,
33+
onClick: () -> Unit = {},
34+
backgroundColor: Color = Main,
35+
textColor: Color = RecordyTheme.colors.gray09,
36+
borderWidth: Dp = 0.dp,
37+
borderColor: Color = Color.Transparent,
38+
rippleColor: Color = White,
39+
) {
40+
BasicButton(
41+
modifier = modifier
42+
.wrapContentWidth(),
43+
text = text,
44+
shape = shape,
45+
onClick = onClick,
46+
backgroundColor = if (enabled) backgroundColor else RecordyTheme.colors.gray08,
47+
rippleColor = rippleColor,
48+
textColor = if (enabled) textColor else RecordyTheme.colors.gray04,
49+
clickable = clickable,
50+
padding = PaddingValues(vertical = 12.dp, horizontal = 38.dp),
51+
textStyle = textStyle,
52+
borderWidth = borderWidth,
53+
borderColor = borderColor,
54+
)
55+
}
56+
57+
@Preview(showBackground = true, backgroundColor = 0xFFFFFF)
58+
@Composable
59+
fun RecordyMiddleButtonPreview() {
60+
RecordyTheme {
61+
RecordyTheme {
62+
Column(
63+
modifier = Modifier
64+
.background(Black)
65+
.padding(vertical = 10.dp, horizontal = 10.dp),
66+
verticalArrangement = Arrangement.spacedBy(10.dp),
67+
) {
68+
RecordyMiddleButton(
69+
text = "키워드",
70+
onClick = { Timber.d("basic key word") },
71+
)
72+
73+
RecordyMiddleButton(
74+
text = "키워드",
75+
enabled = false,
76+
onClick = { Timber.d("basic key word") },
77+
)
78+
}
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)
Please sign in to comment.