|
| 1 | +package com.threegap.bitnagil.presentation.routinelist.component.template |
| 2 | + |
| 3 | +import androidx.compose.foundation.layout.Arrangement |
| 4 | +import androidx.compose.foundation.layout.Column |
| 5 | +import androidx.compose.foundation.layout.Row |
| 6 | +import androidx.compose.foundation.layout.Spacer |
| 7 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 8 | +import androidx.compose.foundation.layout.height |
| 9 | +import androidx.compose.foundation.layout.padding |
| 10 | +import androidx.compose.material3.ExperimentalMaterial3Api |
| 11 | +import androidx.compose.material3.ModalBottomSheet |
| 12 | +import androidx.compose.material3.Text |
| 13 | +import androidx.compose.runtime.Composable |
| 14 | +import androidx.compose.ui.Modifier |
| 15 | +import androidx.compose.ui.tooling.preview.Preview |
| 16 | +import androidx.compose.ui.unit.dp |
| 17 | +import com.threegap.bitnagil.designsystem.BitnagilTheme |
| 18 | +import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton |
| 19 | +import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButtonColor |
| 20 | + |
| 21 | +@OptIn(ExperimentalMaterial3Api::class) |
| 22 | +@Composable |
| 23 | +fun DeleteConfirmBottomSheet( |
| 24 | + onDismissRequest: () -> Unit, |
| 25 | + modifier: Modifier = Modifier, |
| 26 | +) { |
| 27 | + ModalBottomSheet( |
| 28 | + modifier = modifier, |
| 29 | + onDismissRequest = onDismissRequest, |
| 30 | + contentColor = BitnagilTheme.colors.white, |
| 31 | + containerColor = BitnagilTheme.colors.white, |
| 32 | + ) { |
| 33 | + RepeatRoutineDeleteContent( |
| 34 | + modifier = Modifier |
| 35 | + .padding(horizontal = 24.dp) |
| 36 | + .padding(bottom = 26.dp), |
| 37 | + ) |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +@Composable |
| 42 | +fun RepeatRoutineDeleteContent( |
| 43 | + modifier: Modifier = Modifier, |
| 44 | +) { |
| 45 | + Column( |
| 46 | + modifier = modifier, |
| 47 | + ) { |
| 48 | + Text( |
| 49 | + text = "이 루틴은 반복 설정되어 있어요", |
| 50 | + color = BitnagilTheme.colors.coolGray10, |
| 51 | + style = BitnagilTheme.typography.title3SemiBold, |
| 52 | + ) |
| 53 | + |
| 54 | + Spacer(modifier = Modifier.height(10.dp)) |
| 55 | + |
| 56 | + Text( |
| 57 | + text = "오늘만 삭제하거나, 전체 반복 일정에서 모두 삭제할 수\n있습니다. 삭제한 루틴은 되돌릴 수 없어요.", |
| 58 | + color = BitnagilTheme.colors.coolGray40, |
| 59 | + style = BitnagilTheme.typography.body2Medium, |
| 60 | + modifier = Modifier |
| 61 | + .padding(end = 40.dp) |
| 62 | + .fillMaxWidth(), |
| 63 | + ) |
| 64 | + |
| 65 | + Spacer(modifier = Modifier.height(24.dp)) |
| 66 | + |
| 67 | + BitnagilTextButton( |
| 68 | + text = "오늘만 삭제", |
| 69 | + onClick = { /*TODO*/ }, |
| 70 | + modifier = Modifier.fillMaxWidth(), |
| 71 | + textStyle = BitnagilTheme.typography.body2Medium, |
| 72 | + ) |
| 73 | + |
| 74 | + Spacer(modifier = Modifier.height(12.dp)) |
| 75 | + |
| 76 | + BitnagilTextButton( |
| 77 | + text = "모든 날짜에서 삭제", |
| 78 | + onClick = { /*TODO*/ }, |
| 79 | + colors = BitnagilTextButtonColor.delete(), |
| 80 | + modifier = Modifier.fillMaxWidth(), |
| 81 | + textStyle = BitnagilTheme.typography.body2Medium, |
| 82 | + ) |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +@Composable |
| 87 | +fun SingleRoutineDeleteContent( |
| 88 | + modifier: Modifier = Modifier, |
| 89 | +) { |
| 90 | + Column( |
| 91 | + modifier = modifier, |
| 92 | + ) { |
| 93 | + Text( |
| 94 | + text = "루틴을 삭제하시겠어요?", |
| 95 | + color = BitnagilTheme.colors.coolGray10, |
| 96 | + style = BitnagilTheme.typography.title3SemiBold, |
| 97 | + ) |
| 98 | + |
| 99 | + Spacer(modifier = Modifier.height(10.dp)) |
| 100 | + |
| 101 | + Text( |
| 102 | + text = "이 루틴과 관련된 모든 기록이 함께 삭제되며, 삭제 후에는\n되돌릴 수 없습니다. 정말 삭제하시겠어요?", |
| 103 | + color = BitnagilTheme.colors.coolGray40, |
| 104 | + style = BitnagilTheme.typography.body2Medium, |
| 105 | + modifier = Modifier |
| 106 | + .padding(end = 40.dp) |
| 107 | + .fillMaxWidth(), |
| 108 | + ) |
| 109 | + |
| 110 | + Spacer(modifier = Modifier.height(24.dp)) |
| 111 | + |
| 112 | + Row( |
| 113 | + horizontalArrangement = Arrangement.spacedBy(12.dp), |
| 114 | + ) { |
| 115 | + BitnagilTextButton( |
| 116 | + text = "취소", |
| 117 | + onClick = { /*TODO*/ }, |
| 118 | + colors = BitnagilTextButtonColor.cancel(), |
| 119 | + modifier = Modifier.weight(1f), |
| 120 | + textStyle = BitnagilTheme.typography.body2Medium, |
| 121 | + ) |
| 122 | + |
| 123 | + BitnagilTextButton( |
| 124 | + text = "모든 날짜에서 삭제", |
| 125 | + onClick = { /*TODO*/ }, |
| 126 | + modifier = Modifier.weight(1f), |
| 127 | + textStyle = BitnagilTheme.typography.body2Medium, |
| 128 | + ) |
| 129 | + } |
| 130 | + } |
| 131 | +} |
| 132 | + |
| 133 | +@Preview |
| 134 | +@Composable |
| 135 | +private fun DeleteConfirmBottomSheetPreview() { |
| 136 | + DeleteConfirmBottomSheet( |
| 137 | + onDismissRequest = {}, |
| 138 | + ) |
| 139 | +} |
0 commit comments