-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 프로필 수정, 회원 탈퇴 시 다이얼로그 추가 #42
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
Changes from 4 commits
d4f2645
a5e535e
f03a653
8b688d5
d967069
e884c7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package com.alarmy.near.presentation.feature.friendprofileedittor.dialog | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import com.alarmy.near.R | ||
| import com.alarmy.near.presentation.ui.component.dialog.NearBasicDialog | ||
| import com.alarmy.near.presentation.ui.theme.NearTheme | ||
|
|
||
| @Composable | ||
| internal fun SaveConfirmDialog( | ||
| modifier: Modifier = Modifier, | ||
| onDismissRequest: () -> Unit, | ||
| onConfirm: () -> Unit, | ||
| ) { | ||
| NearBasicDialog( | ||
| onDismiss = onDismissRequest, | ||
| body = stringResource(R.string.editor_save_confirm_content), | ||
| dismissButtonText = stringResource(R.string.editor_save_confirm_cancel), | ||
| confirmButtonText = stringResource(R.string.editor_save_confirm_save), | ||
| onDismissButtonClick = onDismissRequest, | ||
| onConfirmButtonClick = onConfirm, | ||
| ) | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun SaveConfirmDialogPreview() { | ||
| NearTheme { | ||
| SaveConfirmDialog( | ||
| onDismissRequest = { }, | ||
| onConfirm = {}, | ||
| ) | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.alarmy.near.presentation.feature.myprofile.dialog | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import com.alarmy.near.R | ||
| import com.alarmy.near.presentation.ui.component.dialog.NearOutlinedDialog | ||
| import com.alarmy.near.presentation.ui.theme.NearTheme | ||
|
|
||
| @Composable | ||
| internal fun WithdrawConfirmDialog( | ||
| modifier: Modifier = Modifier, | ||
| onDismissRequest: () -> Unit, | ||
| onConfirm: () -> Unit, | ||
| ) { | ||
| NearOutlinedDialog( | ||
| onDismiss = onDismissRequest, | ||
| title = null, | ||
| body = stringResource(R.string.withdraw_confirm_content), | ||
| dismissButtonText = stringResource(R.string.withdraw_confirm_cancel), | ||
| confirmButtonText = stringResource(R.string.withdraw_confirm_withdraw), | ||
| onDismissButtonClick = onDismissRequest, | ||
| onConfirmButtonClick = onConfirm, | ||
| ) | ||
|
Comment on lines
17
to
25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 NearOutlinedDialog(
onDismiss = onDismissRequest,
title = null,
body = stringResource(R.string.withdraw_confirm_content),
dismissButtonText = stringResource(R.string.withdraw_confirm_cancel),
confirmButtonText = stringResource(R.string.withdraw_confirm_withdraw),
onDismissButtonClick = onDismissRequest,
onConfirmButtonClick = {
onConfirm()
onDismissRequest()
},
) |
||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun WithdrawConfirmDialogPreview() { | ||
| NearTheme { | ||
| WithdrawConfirmDialog( | ||
| onDismissRequest = { }, | ||
| onConfirm = {}, | ||
| ) | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재
onConfirm콜백에서 다이얼로그를 닫는 로직까지 함께 처리하고 있습니다. 다이얼로그가 확인 동작 후 스스로 닫히도록 책임을 위임하면, 호출부의 코드가 더 간결해지고 컴포넌트의 재사용성이 높아집니다.onConfirmButtonClick콜백 내에서onConfirm()실행 후onDismissRequest()를 호출하도록 수정하는 것을 제안합니다. 이렇게 하면FriendProfileEditorScreen에서onConfirm = onSubmit과 같이 더 간단하게 사용할 수 있습니다.