-
Notifications
You must be signed in to change notification settings - Fork 1
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/#26: option view 구현 #41
Conversation
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.
피곤하셨을텐데 정말 고생하셨습니다!! 최고입니다!
LaunchedEffect( | ||
state.shotQuantity, | ||
state.vanilaSyrupQuantity, | ||
state.caramelSyrupQuantity, | ||
state.hazelnutsSyrupQuantity, | ||
state.creamQuantity, | ||
state.caramelDrizzleQuantity, | ||
state.chocolateDrizzleQuantity | ||
) { | ||
viewModel.calculateTotalPrice() | ||
} |
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.
state 트리거 하면서 cacluateTotalPrice를 실행하는건가요?
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.
맞아요 옵션 값이 하나라도 바뀌면 총 값을 계산하는 함수가 호출되도록 코드를 작성했어요
onClickExpandButton = viewModel::updateExpandedOption, | ||
onClickPlusButton = viewModel::plusOptionQuantity, | ||
onClickMinusButton = viewModel::minusOptionQuantity, |
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.
아까 설명해주신 부분이네요! 다시 공부해야겠당
SHOT(persistentListOf(("샷" to 500))), | ||
SYRUP( | ||
persistentListOf( | ||
"바닐라시럽" to 500, | ||
"헤이즐넛시럽" to 500, | ||
"캬라멜시럽" to 500 | ||
) | ||
), | ||
CREAM(persistentListOf("휘핑크림" to 500)), | ||
DRIZZLE( | ||
persistentListOf( | ||
"캬라멜드리즐" to 500, | ||
"초콜릿드리즐" to 500 |
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.
해당 문자열들이 500으로 바뀌는건가요?
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.
to 를 통해서 String/Int 키:값 쌍을 생성한거에요!
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.
to 를 통해서 String/Int 키:값 쌍을 생성한거에요!
fun calculateTotalPrice() { | ||
_state.value = _state.value.copy( | ||
totalPrice = | ||
_state.value.shotQuantity * OptionType.SHOT.type.first().second | ||
+ _state.value.vanilaSyrupQuantity * OptionType.SYRUP.type.first { it.first == "바닐라시럽" }.second | ||
+ _state.value.hazelnutsSyrupQuantity * OptionType.SYRUP.type.first { it.first == "헤이즐넛시럽" }.second | ||
+ _state.value.caramelSyrupQuantity * OptionType.SYRUP.type.first { it.first == "캬라멜시럽" }.second | ||
+ _state.value.creamQuantity * OptionType.CREAM.type.first().second | ||
+ _state.value.caramelDrizzleQuantity * OptionType.DRIZZLE.type.first { it.first == "캬라멜드리즐" }.second | ||
+ _state.value.chocolateDrizzleQuantity * OptionType.DRIZZLE.type.first { it.first == "초콜릿드리즐" }.second |
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.
무언가 노력의 흔적이 느껴지네요...!
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.
하드코딩의 늪......
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.
고생한 흔적이 보이네요...! 컴포넌트 분리도 열심히 해준게 보여요 !! (제가 지금 졸려서 크게 리뷰 달게 없는건지 모르겟지만.... ㅠㅠ 내일 일때문에 미리 어프해놓을게요 근데 진짜 코리 딱히 뭔가 할 거 없는듯 싶어요 ㅎㅎ 양해 부탁드려요 !!0
PR Convention
☕ ISSUE
❗ WORK DESCRIPTION
📸 SCREENSHOT
default.mp4
📢 TO REVIEWERS