Skip to content

Commit 18d6f61

Browse files
committed
FIX: BitnagilChip의 count인자 제거, 세부 코드 수정
1 parent 40b9d87 commit 18d6f61

4 files changed

Lines changed: 5 additions & 14 deletions

File tree

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilChip.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ fun BitnagilChip(
2222
isSelected: Boolean,
2323
onCategorySelected: () -> Unit,
2424
modifier: Modifier = Modifier,
25-
count: Int? = null,
2625
) {
27-
val chipTitle = if (count == null) title else "$title $count"
28-
2926
Box(
3027
contentAlignment = Alignment.Center,
3128
modifier = modifier
@@ -41,7 +38,7 @@ fun BitnagilChip(
4138
),
4239
) {
4340
Text(
44-
text = chipTitle,
41+
text = title,
4542
color = if (!isSelected) BitnagilTheme.colors.coolGray60 else BitnagilTheme.colors.white,
4643
style = if (!isSelected) BitnagilTheme.typography.caption1Medium else BitnagilTheme.typography.caption1SemiBold,
4744
)
@@ -59,12 +56,5 @@ private fun RecommendCategoryChipStatesPreview() {
5956
isSelected = true,
6057
onCategorySelected = {},
6158
)
62-
63-
BitnagilChip(
64-
title = "나가봐요",
65-
isSelected = false,
66-
onCategorySelected = {},
67-
count = 1,
68-
)
6959
}
7060
}

presentation/src/main/java/com/threegap/bitnagil/presentation/reporthistory/ReportHistoryScreen.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,11 @@ private fun ReportHistoryScreen(
100100

101101
state.reportProcessWithCounts.forEach { reportProcessWithCount ->
102102
BitnagilChip(
103-
title = reportProcessWithCount.process.title,
103+
title = reportProcessWithCount.titleWithCount,
104104
isSelected = state.selectedReportProcess == reportProcessWithCount.process,
105105
onCategorySelected = {
106106
onClickReportProcessChip(reportProcessWithCount.process)
107107
},
108-
count = if (reportProcessWithCount.count == 0) null else reportProcessWithCount.count,
109108
)
110109
}
111110

presentation/src/main/java/com/threegap/bitnagil/presentation/reporthistory/ReportHistoryViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ReportHistoryViewModel @Inject constructor(
2525
}
2626

2727
private fun loadReportHistories() = intent {
28-
getReportHistoriesUseCase.invoke().fold(
28+
getReportHistoriesUseCase().fold(
2929
onSuccess = { reportHistoriesPerDate ->
3030
val reportHistoriesPerDays = reportHistoriesPerDate
3131
.map { reportHistoryPerDateMap ->

presentation/src/main/java/com/threegap/bitnagil/presentation/reporthistory/model/ReportProcessWithCount.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ data class ReportProcessWithCount(
44
val process: ReportProcess,
55
val count: Int,
66
) {
7+
val titleWithCount: String = if (count == 0) process.title else "${process.title} $count"
8+
79
companion object {
810
val Init = ReportProcessWithCount(
911
process = ReportProcess.Total,

0 commit comments

Comments
 (0)