-
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
refactor: next button 분기문 리팩토링 #104
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.
@JNU-econovation/econorecruitefe
아래 코멘트 달린 부분 위주로 리뷰 해주시기 바랍니다~
@@ -13,34 +13,29 @@ interface ApplicationNextButtonProps { | |||
isLast?: boolean; | |||
} | |||
|
|||
// etc. 단순히 boolean이 아닌 어느 곳에서 터지는 지와 그 이유를 담은 객체를 반환하면 어떨까? |
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.
이 논의를 발제한 이유는, 아래 줄에(53L~55L) alert에 넘겨주는 문구를 조금 더 구체화 하고 싶어서 그랬습니다.
포트폴리오 동의여부에서 "동의하지 않습니다"를 선택해도 필수 항목을 입력해달라고 요청하는 게 플로우상 어색해 보인다고 생각했습니다.
물론 포트폴리오를 제출해놓고 동의하지 않는 사람은 없겠죠?ㅋㅋ
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.
음 이부분은 TF분들도 원하시는 것 같아요!
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.
저도 이게 좋은 것 같다는 생각이 있었는데, 구조상 조금 복잡해서 일단 두었었거든요!! ㅠㅠㅠㅠ
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.
일단은 그럼, 다른 이슈로 빼둘께요 !
const EMPTY_STRING: string = ""; | ||
const localStorageValueFromName = localStorage.get(name, EMPTY_STRING); |
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.
magic string을 제거한건 너무 감사하네요
return ( | ||
!(localStorageValueFromName.length === 0) || | ||
(name === "channel" && localStorage.get("channelEtc", "").length !== 0) | ||
); |
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.
? 미쳤다... ㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷ ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 아니 이게 가능하다고?
@@ -57,7 +52,7 @@ const ApplicationNextButton = ({ | |||
); | |||
if (!canNext(Array.from(applicationName))) { | |||
alert("필수 항목을 입력해주세요."); | |||
return false; | |||
return; |
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.
이벤트 핸들러에서 boolean을 반환할 필요가 없다고 생각해 undefined으로 변경하였습니다.
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.
혹시 몰라 더 찾아봤는데, 바닐라 자바스크립트에서는 이벤트핸들러가 false를 반환하면 기본 동작(이벤트 버블링)을 취소한다네요!
하지만 React에서는 지원하지 않는다고 합니다. (레거시 문서지만 현재버전까지 유지되는 내용 같아요 ! )
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.
저도 습관적으로 저걸 반환하긴 했는데, react는 (0.14라면 꾀나 예전이네요 ㅋㅋㅋ) 안했었군요 !! ㅋㅋㅋㅋ
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.
좋습니다!!
} | ||
return true; | ||
return ( |
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.
깔끔해졌네요.. 👍
frontend/components/application/applicationNode/NextButton.component.tsx
Outdated
Show resolved
Hide resolved
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.
수고하셨습니다!
@@ -13,34 +13,29 @@ interface ApplicationNextButtonProps { | |||
isLast?: boolean; | |||
} | |||
|
|||
// etc. 단순히 boolean이 아닌 어느 곳에서 터지는 지와 그 이유를 담은 객체를 반환하면 어떨까? |
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.
좋은 것 같아요~
return ( | ||
!(localStorageValueFromName.length === 0) || | ||
(name === "channel" && localStorage.get("channelEtc", "").length !== 0) | ||
); |
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.
우와...깔끔하고 좋네요
Co-authored-by: Ocean <[email protected]>
@@ -13,34 +13,29 @@ interface ApplicationNextButtonProps { | |||
isLast?: boolean; | |||
} | |||
|
|||
// etc. 단순히 boolean이 아닌 어느 곳에서 터지는 지와 그 이유를 담은 객체를 반환하면 어떨까? |
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.
좋네요!
@@ -13,34 +13,29 @@ interface ApplicationNextButtonProps { | |||
isLast?: boolean; | |||
} | |||
|
|||
// etc. 단순히 boolean이 아닌 어느 곳에서 터지는 지와 그 이유를 담은 객체를 반환하면 어떨까? |
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.
저도 이게 좋은 것 같다는 생각이 있었는데, 구조상 조금 복잡해서 일단 두었었거든요!! ㅠㅠㅠㅠ
@@ -57,7 +52,7 @@ const ApplicationNextButton = ({ | |||
); | |||
if (!canNext(Array.from(applicationName))) { | |||
alert("필수 항목을 입력해주세요."); | |||
return false; | |||
return; |
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.
좋아용
const EMPTY_STRING: string = ""; | ||
const localStorageValueFromName = localStorage.get(name, EMPTY_STRING); |
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.
magic string을 제거한건 너무 감사하네요
주요 변경사항
리뷰어에게...
관련 이슈
(closed를 하는게 나을까요?)