-
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/calendar default layout #12
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.
수고하셨습니다!👍🏼
import { MONTH_HEADER } from "@/constants/testId"; | ||
import React from "react"; | ||
|
||
const days = ["일", "월", "화", "수", "목", "금", "토"]; |
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.
constants 폴더에 일정 상수로 보관하는 것도 방법인 것같습니다!
이로 인해서 다른 월/주/일
뷰에서도 사용할 수 있다고 생각합니다:D
{randerRange === null && <EmptyLayout />} | ||
{randerRange && ( | ||
<div className="flex flex-col h-full divide-y-[1px]"> | ||
{randerRange.map((week, index) => ( | ||
<div key={index} className="flex flex-1 divide-x-[1px] "> | ||
{week.map((day, index) => ( | ||
<div key={index} className="flex flex-col flex-1"> | ||
<MonthUnit day={day} /> | ||
</div> | ||
))} | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
</section> | ||
); | ||
} |
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.
사실 최근들어서 말씀해주신 대로 코드가독성의 문제 때문에 삼항연산자나 else if 대신 단일 if문을 작성하는 식으로 진행하고 있는데,
저 randerRange..... renderRange인데 이 코멘트를 작성하면서 오타를 발견했네요...
최근엔 그 방법이 아무튼 renderRange 에 따라서 어떤 값이 렌더링 될 예정인지 조금 더 명시적으로 보여지는 것 같다는 생각입니다.
그런데 지금 보니 어차피 EmptyLayout도 따로 뺀 김에 실제 데이터 렌더링 Iterator 도 따로 빼서 삼항연산자로 구현하면 조금 더 보기 편할 것 같다는 생각이 드네요? 한번 이 부분은 고쳐보도록 하겠습니다.
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.
답변 감사합니다! 좀 더 생각을 하게 되어서 좋은 것같습니다 ㅎㅎ
개요
작업 분류
작업 상세 내용
1. 캘린더 월 단위 레이아웃과 wheel action을 구현했습니다.
Query Params 를 활용하여 월단위 달력 위에서 onWheel 이벤트를 감지할 경우 Month가 변하도록 구현했습니다.
기존의 참고자료인 애플캘린더의 경우 무한스크롤과 scroll action 을 통해 항상 6개 Row의 레이아웃을 구성하였으나,
현재 무한스크롤 + scroll action 을 구현하기엔 난이도가 상당하여 우선 6개 Row만 가지고있는 wheel action 레이아웃으로 구성했습니다.
2. preinstall 스크립트가 추가되었습니다.
husky 세팅은 제대로 되어있으나, 매번
yarn install
이후yarn husky
를 하기엔 귀찮기도 하고 까먹는 경우도 존재하는 듯 하여 preinstall script를 추가했습니다.추후 새로운 feature branch를 따실때에도 husky 세팅을 걱정하지 않으셔도 됩니다.
3. .storybook/main.ts 변경
아직 제대로 storybook을 활용하여 개발을 하고있지 않다보니 사실 이게 맞는 변경인지는 모르겠습니다만, 해당 파일 들여다보던 중 staticDir가 아닌 staticDirs 라는 에러가 발생해서 어쩔 수 없이 수정했습니다.
개선 필요