Skip to content

Commit

Permalink
[ADD/#11] InternListType Enum class 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Jul 10, 2024
1 parent 3b353e6 commit 8321ae2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
19 changes: 14 additions & 5 deletions feature/src/main/java/com/terning/feature/search/SearchRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.terning.core.designsystem.theme.Grey100
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.feature.R
import com.terning.feature.search.component.ImageSlider
import com.terning.feature.search.component.InternListType
import com.terning.feature.search.component.SearchInternList

@Composable
Expand All @@ -41,15 +42,20 @@ fun SearchScreen() {
modifier = Modifier
.fillMaxWidth()
) {
Box(modifier = Modifier.padding(16.dp)) {
Box(
modifier = Modifier.padding(
horizontal = 24.dp,
vertical = 16.dp
)
) {
SearchTextField(
text = text,
onValueChange = { newText ->
text = newText
},
readOnly = true,
hint = stringResource(R.string.search_text_field_hint),
leftIcon = R.drawable.ic_nav_search,
readOnly = true,
)
}

Expand All @@ -61,17 +67,20 @@ fun SearchScreen() {

Text(
text = stringResource(id = R.string.search_today_popular),
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp),
modifier = Modifier.padding(
horizontal = 24.dp,
vertical = 4.dp
),
style = TerningTheme.typography.title1,
color = Black
)

SearchInternList(type = "view")
SearchInternList(type = InternListType.VIEW)
HorizontalDivider(
thickness = 4.dp,
modifier = Modifier.padding(vertical = 8.dp),
color = Grey100,
)
SearchInternList(type = "scrap")
SearchInternList(type = InternListType.SCRAP)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.terning.feature.search.component

enum class InternListType(val type: String) {
VIEW("view"),
SCRAP("scrap");
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import com.terning.feature.R

@Composable
fun SearchInternList(
type: String,
type: InternListType,
) {
Column(modifier = Modifier.padding(horizontal = 16.dp)) {
Column(modifier = Modifier.padding(horizontal = 24.dp)) {
Text(
text = stringResource(
id = if (type == "view") R.string.search_most_view_intern
else R.string.search_most_scrap_intern
id = when (type) {
InternListType.VIEW -> R.string.search_most_view_intern
InternListType.SCRAP -> R.string.search_most_scrap_intern
}
),
style = TerningTheme.typography.title5,
color = Grey400
Expand Down

0 comments on commit 8321ae2

Please sign in to comment.