-
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
[Feat] RushEvent 컴포넌트 구현 #70
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.
고생하셨서용🙌
@@ -0,0 +1,8 @@ | |||
export const formatDate = (dateString: string): string => { | |||
const date = new Date(dateString); |
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.
이때 date 포맷이 아닌 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.
감사합니당 반영했습니다!
client/src/utils/formatDate.ts
Outdated
const date = new Date(dateString); | ||
const month = date.getMonth() + 1; | ||
const day = date.getDate(); | ||
const dayOfWeek = ["일", "월", "화", "수", "목", "금", "토"][date.getDay()]; |
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 dayOfWeek = ["일", "월", "화", "수", "목", "금", "토"][date.getDay()]; | |
const DAY_OF_WEEK = ["일", "월", "화", "수", "목", "금", "토"]; | |
... | |
const today = dayOfWeek[date.getDay()]; |
["일", "월", "화", "수", "목", "금", "토"]
랑 index가 바로 붙어있으니까 쪼금 헷갈리는 것 같아서 위 예시처럼 따로 상수로 빼주는게 좀 더 가독성이 좋지 않을까 하는 생각입니덩
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.
역시!! 너무 좋은생각입니다 :) 리팩토링 여신님 말따르겠습니다!
className={`relative w-[160px] h-[200px] py-7 px-5 rounded-500 bg-n-white flex flex-col gap-4 justify-between items-center border ${borderClass} ${opacityClass}`} | ||
> | ||
<p | ||
className={`h-body-2-bold ${isTodayEvent ? "text-s-red" : "text-n-neutral-950"} text-nowrap`} |
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.
요 삼항 연산자도 borderClass
나 opacityClass
처럼 빼주는게 통일성 있지 않을까 싶어용
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.
네 바로 반영하겠습니당!!
빌드를 성공했습니다! 🎉 |
빌드를 성공했습니다! 🎉 |
빌드를 실패했습니다. ❌ 자세한 내용은 로그를 참고해주세요. |
빌드를 성공했습니다! 🎉 |
🖥️ Preview
✏️ 한 일
close 선착순 이벤트 경품 컴포넌트 구현 #58
❗️ 발생한 이슈 (해결 방안)
👺 커밋명 하나 잘못 올려버렸다..
refactor: lotteryEventData storybook 경로 수정
-> feat: RushEvent 컴포넌트 UI 구현
❓ 논의가 필요한 사항