Skip to content
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

[Feature]가게 선택 다이얼로그 생성 #401

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

hsgo2430
Copy link
Contributor

@hsgo2430 hsgo2430 commented Oct 2, 2024

개요


  • 가게 선택 다이얼로그 생성

상세 작업 내용


  • Dialog 컴포저블을 이용하여 커스텀 다이얼로그 생성
  • 가게 선택 시 해당 가게 데이터 가져오도록 수정

작업 결과물

  • 다이얼로그
  • 가게 선택 작동

@hsgo2430 hsgo2430 requested a review from a team as a code owner October 2, 2024 09:06
@hsgo2430 hsgo2430 self-assigned this Oct 2, 2024

@Preview
@Composable
fun PreviewMyStoreSelectDialog() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun PreviewMyStoreSelectDialog() {
private fun PreviewMyStoreSelectDialog() {

val isEventExpanded: List<Boolean> = List(storeEvent?.size ?: 0) { false },
val isAllEventSelected: Boolean = false,
val isSelectedEvent: MutableList<Int> = mutableListOf(),
val isEditMode: Boolean = false
val isEditMode: Boolean = false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val isEditMode: Boolean = false,
val isEditMode: Boolean = false

@@ -83,14 +78,20 @@ fun MyStoreDetailScreen(
val context = LocalContext.current

LaunchedEffect(state.storeInfo) {
viewModel.initOwnerShopList()
viewModel.changeMyStoreInfo(storeId = state.storeId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewModel에서 변경할수있는 로직같습니다. 확인해주세요

Copy link
Contributor

@yunjaena yunjaena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 확인해주세요~!

ModifyInfoSideEffect.NavigateToMyStoreScreen -> {
storeInfoViewModel.modifyStoreInfo(state.storeInfo)
storeInfoViewModel.refreshStoreList()
onModifyButtonCLicked()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onModifyButtonCLicked()
onModifyButtonClicked()

@@ -279,7 +279,11 @@ fun ModifyInfoScreen(
when (it) {
ModifyInfoSideEffect.NavigateToBackScreen -> onBackClicked()
ModifyInfoSideEffect.NavigateToSettingOperatingTime -> onSettingOperatingClicked()
else -> {}
ModifyInfoSideEffect.NavigateToMyStoreScreen -> {
storeInfoViewModel.modifyStoreInfo(state.storeInfo)
Copy link
Contributor

@yunjaena yunjaena Oct 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify가 완료가 되고 refresh를 해야되는게 아닌가요? (실패했을경우?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그래서 뷰모델에서

modifyInfoUseCase.invoke(
                    storeId,
                    storeDetailInfo,
                ).apply {
                    this ?: postSideEffect(ModifyInfoSideEffect.NavigateToMyStoreScreen)
                }    

이 코드를 통해 ErrorHandler가 null일 때 ModifyInfoSideEffect.NavigateToMyStoreScreen를 보내는 것으로 구현했습니다!

Copy link
Contributor

@yunjaena yunjaena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 수고하셨습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants