Skip to content

[Feat/#125] BrainDump 변경 및 2차 qa #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fun MementoDialog(
onEdit: () -> Unit,
dialogType: DialogType,
planId: Int,
refreshKey: Boolean,
viewModel: TodayViewModel = hiltViewModel(),
) {
val scheduleDetailState by viewModel.detailScheduleState.collectAsStateWithLifecycle()
Expand All @@ -67,7 +68,7 @@ fun MementoDialog(
var todoData by remember { mutableStateOf<TodoDetail?>(null) }

if (showDialog) {
LaunchedEffect(dialogType, planId) {
LaunchedEffect(dialogType, planId, refreshKey) {
when (dialogType) {
DialogType.SCHEDULE -> {
viewModel.getScheduleDetail(scheduleId = planId)
Expand Down Expand Up @@ -581,6 +582,7 @@ fun MementoDialogPreview() {
onDismiss = closeDialog,
onDelete = { },
onEdit = { },
refreshKey = false,
dialogType = DialogType.SCHEDULE,
planId = 1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun MementoEditScheduleBottomSheet(
}

ModalBottomSheet(
onDismissRequest = { onConfirm() },
onDismissRequest = { onCancel() },
sheetState = sheetState,
shape = RoundedCornerShape(topStart = 0.dp, topEnd = 0.dp),
containerColor = darkModeColors.gray10,
Expand All @@ -51,10 +51,9 @@ fun MementoEditScheduleBottomSheet(
.imePadding(),
) {
AddScheduleScreen(
onCloseBottomSheet = { },
onCloseBottomSheet = { onConfirm() },
isEdit = true,
isEditCancel = { onCancel() },
isEditDone = { onConfirm() },
planId = planId,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun MementoEditTodoBottomSheet(
}

ModalBottomSheet(
onDismissRequest = { onConfirm() },
onDismissRequest = { onCancel() },
sheetState = sheetState,
shape = RoundedCornerShape(topStart = 0.dp, topEnd = 0.dp),
containerColor = darkModeColors.gray10,
Expand All @@ -73,12 +73,11 @@ fun MementoEditTodoBottomSheet(
onNavigateEisenHourSetting = {
currentBottomSheet = BottomSheetType.EISEN
},
onCloseBottomSheet = { },
isEdit = true,
planId = planId,
isEditDone = {
onCloseBottomSheet = {
onConfirm()
},
isEdit = true,
planId = planId,
isEditCancel = {
onCancel()
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.memento.presentation.component

import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import org.memento.ui.theme.darkModeColors

/**
* @param modifier modifier 수정 사항
* @param isSwitchOn 초기 Switch의 체크 상태
* @param onSwitchChange Switch의 상태 변경에 따른 로직
*/

@Composable
fun MementoSwitchButton(
modifier: Modifier = Modifier,
isSwitchOn: Boolean,
onSwitchChange: (Boolean) -> Unit,
) {
Switch(
checked = isSwitchOn,
onCheckedChange = onSwitchChange,
modifier = modifier,
colors =
SwitchDefaults.colors(
checkedThumbColor = darkModeColors.white,
checkedTrackColor = darkModeColors.gray08,
uncheckedThumbColor = darkModeColors.gray06,
uncheckedTrackColor = darkModeColors.gray07,
),
)
}

@Preview
@Composable
fun MementoSwitchButtonPreview() {
var isSwitchOn by remember { mutableStateOf(false) }

MementoSwitchButton(
isSwitchOn = isSwitchOn,
onSwitchChange = { isToggled ->
isSwitchOn = isToggled
if (isSwitchOn) {
// TODO(): 자연어 처리, 공지 알림 로직 구현
}
},
)
}
3 changes: 0 additions & 3 deletions app/src/main/java/org/memento/presentation/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import org.memento.presentation.plusbottomsheet.AddToDoDeadLineScreen
import org.memento.presentation.plusbottomsheet.AddToDoEisenScreen
import org.memento.presentation.plusbottomsheet.AddToDoTagScreen
import org.memento.presentation.plusbottomsheet.AddToDoViewModel
import org.memento.presentation.plusbottomsheet.BrainDumpViewModel
import org.memento.presentation.plusbottomsheet.MainPlusBottomSheet
import org.memento.presentation.type.BottomSheetType
import org.memento.ui.theme.darkModeColors
Expand All @@ -54,7 +53,6 @@ fun MainScreenContent(
navigator: MainNavigator,
addToDoViewModel: AddToDoViewModel = hiltViewModel(),
addScheduleViewModel: AddScheduleViewModel = hiltViewModel(),
brainDoViewModel: BrainDumpViewModel = hiltViewModel(),
) {
val coroutineScope = rememberCoroutineScope()
val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
Expand All @@ -65,7 +63,6 @@ fun MainScreenContent(
currentBottomSheet = null
addToDoViewModel.resetData()
addScheduleViewModel.resetData()
brainDoViewModel.resetData()
coroutineScope.launch {
bottomSheetState.hide()
}
Expand Down
Loading