@@ -12,10 +12,6 @@ import androidx.compose.runtime.Composable
1212import androidx.compose.runtime.rememberCoroutineScope
1313import androidx.compose.ui.Alignment
1414import androidx.compose.ui.Modifier
15- import androidx.compose.ui.text.SpanStyle
16- import androidx.compose.ui.text.buildAnnotatedString
17- import androidx.compose.ui.text.style.BaselineShift
18- import androidx.compose.ui.text.withStyle
1915import androidx.compose.ui.tooling.preview.Preview
2016import androidx.compose.ui.unit.dp
2117import com.threegap.bitnagil.designsystem.BitnagilTheme
@@ -51,7 +47,8 @@ fun RecommendLevelBottomSheet(
5147 ) {
5248 RecommendLevel .entries.forEachIndexed { index, recommendLevel ->
5349 LevelOption (
54- optionText = " 난이도 ${recommendLevel.toKoreanLevel()} | ${recommendLevel.displayName} " ,
50+ optionLevel = recommendLevel.koreanLevel,
51+ optionText = recommendLevel.displayName,
5552 isSelected = selectedRecommendLevel == recommendLevel,
5653 onClick = {
5754 val newLevel = if (selectedRecommendLevel == recommendLevel) null else recommendLevel
@@ -79,6 +76,7 @@ fun RecommendLevelBottomSheet(
7976
8077@Composable
8178private fun LevelOption (
79+ optionLevel : String ,
8280 optionText : String ,
8381 isSelected : Boolean ,
8482 onClick : () -> Unit ,
@@ -90,35 +88,16 @@ private fun LevelOption(
9088 .clickableWithoutRipple { onClick() }
9189 .padding(vertical = 8 .dp),
9290 ) {
93- val parts = optionText.split(" | " )
94- val annotatedString = buildAnnotatedString {
95- if (parts.size >= 2 ) {
96- withStyle(
97- style = BitnagilTheme .typography.body1SemiBold.toSpanStyle(),
98- ) {
99- append(parts[0 ])
100- }
101-
102- withStyle(
103- style = SpanStyle (
104- color = BitnagilTheme .colors.coolGray10,
105- baselineShift = BaselineShift (0.1f ),
106- ),
107- ) {
108- append(" | " )
109- }
110-
111- withStyle(
112- style = BitnagilTheme .typography.body1Regular.toSpanStyle(),
113- ) {
114- append(parts[1 ])
115- }
116- }
117- }
91+ Text (
92+ text = " 난이도 $optionLevel " ,
93+ color = BitnagilTheme .colors.coolGray10,
94+ style = BitnagilTheme .typography.body1SemiBold
95+ )
11896
11997 Text (
120- text = annotatedString ,
98+ text = " | $optionText " ,
12199 color = BitnagilTheme .colors.coolGray10,
100+ style = BitnagilTheme .typography.body1Regular,
122101 modifier = Modifier .weight(1f ),
123102 )
124103
@@ -135,7 +114,8 @@ private fun LevelOption(
135114@Composable
136115private fun LevelOptionPreview () {
137116 LevelOption (
138- optionText = " 난이도 상 | 가볍게 할 수 있어요" ,
117+ optionLevel = " 상" ,
118+ optionText = " 가볍게 할 수 있어요" ,
139119 isSelected = true ,
140120 onClick = {},
141121 )
0 commit comments