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/#26: option view 구현 #41

Merged
merged 19 commits into from
Nov 28, 2024
Merged

feature/#26: option view 구현 #41

merged 19 commits into from
Nov 28, 2024

Conversation

hyeeum
Copy link
Collaborator

@hyeeum hyeeum commented Nov 27, 2024

PR Convention

☕ ISSUE

❗ WORK DESCRIPTION

  • 옵션 뷰 완료

📸 SCREENSHOT

default.mp4

📢 TO REVIEWERS

  • 이거 진짜 코드가 똥이라서.. 스트링 추출도 일부러 안했어요 싹 밀어버려야 할 듯... 죄송함다
  • 내 코드는 똥이다
  • 옵션에 있는 메뉴들을 어떻게 묶어서 사용할 수 있을지 고민하다가 ㅠㅠ... 시간만 버리고 마지막에는 QA로 급해서 일단 하드코딩 수준으로 작성했어요.. 일단 급한 불 먼저 끄고 ㅠㅠ

@hyeeum hyeeum added 혜음 ( ˶’ᵕ’˶ ) 혜음 전용 라벨 🎉feature🎉 새로운 기능 labels Nov 27, 2024
@hyeeum hyeeum added this to the UI 구현 milestone Nov 27, 2024
@hyeeum hyeeum self-assigned this Nov 27, 2024
@hyeeum hyeeum added the 🎨ui🎨 ui 구현 label Nov 27, 2024
Copy link
Member

@sayyyho sayyyho left a comment

Choose a reason for hiding this comment

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

피곤하셨을텐데 정말 고생하셨습니다!! 최고입니다!

Comment on lines +39 to +49
LaunchedEffect(
state.shotQuantity,
state.vanilaSyrupQuantity,
state.caramelSyrupQuantity,
state.hazelnutsSyrupQuantity,
state.creamQuantity,
state.caramelDrizzleQuantity,
state.chocolateDrizzleQuantity
) {
viewModel.calculateTotalPrice()
}
Copy link
Member

Choose a reason for hiding this comment

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

state 트리거 하면서 cacluateTotalPrice를 실행하는건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

맞아요 옵션 값이 하나라도 바뀌면 총 값을 계산하는 함수가 호출되도록 코드를 작성했어요

Comment on lines +55 to +57
onClickExpandButton = viewModel::updateExpandedOption,
onClickPlusButton = viewModel::plusOptionQuantity,
onClickMinusButton = viewModel::minusOptionQuantity,
Copy link
Member

Choose a reason for hiding this comment

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

아까 설명해주신 부분이네요! 다시 공부해야겠당

Comment on lines +18 to +30
SHOT(persistentListOf(("샷" to 500))),
SYRUP(
persistentListOf(
"바닐라시럽" to 500,
"헤이즐넛시럽" to 500,
"캬라멜시럽" to 500
)
),
CREAM(persistentListOf("휘핑크림" to 500)),
DRIZZLE(
persistentListOf(
"캬라멜드리즐" to 500,
"초콜릿드리즐" to 500
Copy link
Member

Choose a reason for hiding this comment

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

해당 문자열들이 500으로 바뀌는건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to 를 통해서 String/Int 키:값 쌍을 생성한거에요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to 를 통해서 String/Int 키:값 쌍을 생성한거에요!

Comment on lines +121 to +130
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
Copy link
Member

Choose a reason for hiding this comment

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

무언가 노력의 흔적이 느껴지네요...!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

하드코딩의 늪......

Copy link
Collaborator

@kangyein9892 kangyein9892 left a comment

Choose a reason for hiding this comment

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

고생한 흔적이 보이네요...! 컴포넌트 분리도 열심히 해준게 보여요 !! (제가 지금 졸려서 크게 리뷰 달게 없는건지 모르겟지만.... ㅠㅠ 내일 일때문에 미리 어프해놓을게요 근데 진짜 코리 딱히 뭔가 할 거 없는듯 싶어요 ㅎㅎ 양해 부탁드려요 !!0

@hyeeum hyeeum merged commit a3042fc into develop Nov 28, 2024
@hyeeum hyeeum deleted the feature/#26-option-view branch November 28, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
혜음 ( ˶’ᵕ’˶ ) 혜음 전용 라벨 🎉feature🎉 새로운 기능 🎨ui🎨 ui 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] 옵션 뷰 구현
3 participants