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

refactor: 필수 질문을 모두 확인하도록 수정 #142

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

loopy-lim
Copy link
Collaborator

주요 변경사항

  • 필수 질문을 최적화하였습니다.
  • 만약 그 질문을 쓰지 않으면 그 질문으로 이동합니다.
  • 코드를 한 곳으로 몰았습니다.

리뷰어에게...

관련 이슈

loopy-lim added 2 commits March 6, 2024 22:43
- useSendAppliction -> useApplication
- canNext -> canApplicationNext(in useApplication)
- remove when no data in getApplicationValues
@loopy-lim loopy-lim self-assigned this Mar 6, 2024
@loopy-lim loopy-lim requested a review from BlackBean99 as a code owner March 6, 2024 15:04
Comment on lines +32 to +51
switch (name) {
case "personalInformationAgreeForPortfolio":
case "personalInformationAgree":
return localStorageValueFromName !== "동의합니다."
? "personalInformationAgree"
: "";
case "email":
return !isEmail(localStorageValueFromName) ? "email" : "";
case "check":
return localStorageValueFromName !== "확인했습니다" ? "check" : "";
case "channel":
return localStorageValueFromName.length === 0 &&
localStorage.get("channelEtc", EMPTY_STRING).length === 0
? "channel"
: "";
default:
return localStorageValueFromName.length === 0 ? name : "";
}
})
.filter((name) => name.length !== 0);
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

Choose a reason for hiding this comment

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

함수형을 공부하고 다시 와보죠

Copy link
Collaborator

@baegyeong baegyeong left a comment

Choose a reason for hiding this comment

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

저는 잘 짜여졌다고 생각합니다 아직 제가 이해하기는 조금 어렵지만!!
그리고 useApplication 함수가 좀 길어진 것 같은데 어떻게 분리할 방안이 없을까요??..
너무 수고많으셨습니다

Copy link
Collaborator

@2yunseong 2yunseong 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 +32 to +51
switch (name) {
case "personalInformationAgreeForPortfolio":
case "personalInformationAgree":
return localStorageValueFromName !== "동의합니다."
? "personalInformationAgree"
: "";
case "email":
return !isEmail(localStorageValueFromName) ? "email" : "";
case "check":
return localStorageValueFromName !== "확인했습니다" ? "check" : "";
case "channel":
return localStorageValueFromName.length === 0 &&
localStorage.get("channelEtc", EMPTY_STRING).length === 0
? "channel"
: "";
default:
return localStorageValueFromName.length === 0 ? name : "";
}
})
.filter((name) => name.length !== 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

함수형을 공부하고 다시 와보죠

Copy link
Collaborator

Choose a reason for hiding this comment

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

와.. 길다

@loopy-lim
Copy link
Collaborator Author

사실 보내는 함수쪽이 좀 긴거 같아요..... 여기서 몇개 빼서 순수함수처럼 만들 수 있으니 그걸 활용해야겠어요

@loopy-lim
Copy link
Collaborator Author

일단 오늘 내로 처리해야하는 문제라 닫겠습니다. 추후 리뷰 해주시면, 다시 열어서 고치겠습니다!

@loopy-lim loopy-lim merged commit 02732a8 into main Mar 6, 2024
1 check passed
Copy link
Collaborator

@bada308 bada308 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 👍
훅으로 뽑아내니까 컴포넌트가 깔끔해진 것 같아요!

useApplication 훅 내에 복잡한 로직들을 함수로 뽑아내서 이름을 붙이면 조금 더 흐름을 파악하는데 도움이 될 것 같습니다.

@2yunseong 2yunseong deleted the refactor/141-better-then-next-button branch September 9, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] refactor: 현재 check하는 타입이 복잡합니다. 이를 최소화합니다.
4 participants