Skip to content

Commit 3261a63

Browse files
committed
Refactor: DeleteConfirmBottomSheet 컴포넌트 파라미터 수정
1 parent 6959704 commit 3261a63

2 files changed

Lines changed: 3 additions & 24 deletions

File tree

presentation/src/main/java/com/threegap/bitnagil/presentation/routinelist/RoutineListScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fun RoutineListScreenContainer(
4848
if (uiState.deleteConfirmBottomSheetVisible) {
4949
uiState.selectedRoutine?.let { routine ->
5050
DeleteConfirmBottomSheet(
51-
routine = routine,
51+
isRepeatRoutine = routine.repeatDay.isNotEmpty(),
5252
onDismissRequest = { viewModel.sendIntent(RoutineListIntent.HideDeleteConfirmBottomSheet) },
5353
onDeleteToday = viewModel::deleteRoutineForToday,
5454
onDeleteAll = viewModel::deleteRoutineCompletely,

presentation/src/main/java/com/threegap/bitnagil/presentation/routinelist/component/template/DeleteConfirmBottomSheet.kt

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ import androidx.compose.ui.unit.dp
1717
import com.threegap.bitnagil.designsystem.BitnagilTheme
1818
import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton
1919
import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButtonColor
20-
import com.threegap.bitnagil.presentation.routinelist.model.RoutineUiModel
2120

2221
@OptIn(ExperimentalMaterial3Api::class)
2322
@Composable
2423
fun DeleteConfirmBottomSheet(
25-
routine: RoutineUiModel,
24+
isRepeatRoutine: Boolean,
2625
onDismissRequest: () -> Unit,
2726
onDeleteToday: () -> Unit,
2827
onDeleteAll: () -> Unit,
@@ -35,7 +34,7 @@ fun DeleteConfirmBottomSheet(
3534
contentColor = BitnagilTheme.colors.white,
3635
containerColor = BitnagilTheme.colors.white,
3736
) {
38-
if (routine.repeatDay.isNotEmpty()) {
37+
if (isRepeatRoutine) {
3938
RepeatRoutineDeleteContent(
4039
onDeleteToday = onDeleteToday,
4140
onDeleteAll = onDeleteAll,
@@ -170,23 +169,3 @@ private fun RepeatRoutineDeleteContentPreview() {
170169
modifier = Modifier.padding(24.dp),
171170
)
172171
}
173-
174-
@Preview
175-
@Composable
176-
private fun DeleteConfirmBottomSheetPreview() {
177-
DeleteConfirmBottomSheet(
178-
routine = RoutineUiModel(
179-
routineId = "1",
180-
routineName = "물마시기",
181-
repeatDay = listOf(),
182-
routineDate = "",
183-
executionTime = "08:00",
184-
recommendedRoutineType = null,
185-
subRoutineNames = emptyList()
186-
),
187-
onDismissRequest = {},
188-
onDeleteToday = {},
189-
onDeleteAll = {},
190-
onCancel = {},
191-
)
192-
}

0 commit comments

Comments
 (0)