-
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] Date Picker 제작 #76
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.
datepicker 커스텀 쉽지 않으셨을텐데 너무 깔끔하게 잘 해주셨네요 라이브러리 커스텀 방식에서 많이 배워갑니다. util함수도 다른 곳에서 잘 사용할 거 같아요 조으네용 퍼블리싱 뿐만 아니라 날짜 선택 계산 까지 같이 해주셔서 정말 수고 많으셨습니다 🥇
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.
이렇게 header만 따로 빼서 커스텀 하니 확실하게 커스텀도 가능하고 넘 보기도 좋네요!! 고생 많으셨습니다
import styled from '@emotion/styled'; | ||
|
||
import ArrangeBtn from '../arrangeBtn/ArrangeBtn'; | ||
import TextboxInput from '../textbox/TextboxInput'; |
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해주시면 더욱 좋을 것 같습니당
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.
냅두겠습니다 !
calendarContainer={CalendarStyle} | ||
renderCustomHeader={(props) => ( | ||
<CustomHeader | ||
{...props} |
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.
라이브러리에서 제공하는 props를 {...props}
로 커스텀 컴포넌트에 전달할 수 있군요! 저도 라이브러리 커스텀때 참고하도록 하겠습니당 많이 배워갑니다 히히
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.
직접 안받는 부분이 라이브러리에서 제공해주는 props들인건가요?? 신기하다.. 👍 👍 이래서 라이브러리 쓰는구낭
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
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-datepicker__day--in-selecting-range { | ||
color: ${({ theme }) => theme.palette.Grey.Grey7}; | ||
|
||
background-color: ${({ theme }) => theme.palette.Blue.Blue2}; | ||
} | ||
|
||
.react-datepicker__day--in-range { | ||
color: ${({ theme }) => theme.palette.Grey.Grey7}; | ||
|
||
background-color: ${({ theme }) => theme.palette.Blue.Blue2}; | ||
} |
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.
우하하 넵!
calendarContainer={CalendarStyle} | ||
renderCustomHeader={(props) => ( | ||
<CustomHeader | ||
{...props} |
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.
직접 안받는 부분이 라이브러리에서 제공해주는 props들인건가요?? 신기하다.. 👍 👍 이래서 라이브러리 쓰는구낭
const onChange = (dates: [Date | null, Date | null]) => { | ||
const [start, end] = dates; | ||
setStartDate(start); | ||
blurRef(startDateTextRef); | ||
if (startDateTextRef.current) { | ||
startDateTextRef.current.value = formatDatetoString(start); | ||
} | ||
|
||
setEndDate(end); | ||
blurRef(endDateTextRef); | ||
if (endDateTextRef.current) { | ||
endDateTextRef.current.value = formatDatetoString(end); | ||
} | ||
}; | ||
const onDateChange = (date: Date, mode: 'start' | 'end') => { | ||
if (mode === 'start') { | ||
blurRef(startDateTextRef); | ||
setStartDate(date); | ||
} else { | ||
blurRef(endDateTextRef); | ||
setEndDate(date); | ||
} | ||
}; |
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.
수정했다!
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 [startDate, setStartDate] = useState<Date | null>(new Date()); | ||
const [endDate, setEndDate] = useState<Date | null>(null); | ||
const startDateTextRef = useRef<HTMLInputElement>(null); | ||
const endDateTextRef = useRef<HTMLInputElement>(null); |
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.
레전드 타입 선언이네요,, 저도 캘린더 커승텀할 때 여기서 타입에 null 넣어주면 다른데서 타입 에러 뜨고 굉장히 애먹었던 경험이 있는데 잘 잡아주셨군요! 짱짱
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.
ref 타입이 좀 어렵더라구요 .......이거 하면서 배워갑니당
startDate={startDate as Date | undefined} | ||
endDate={endDate as Date | 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.
승연이의 눈물이 담긴 코드네요,,, 라이브러리 안에서 지정된 타입으로 선언해야 한다니,, 정말 라이브러리 커스텀은 어렵군뇨,,, 수고 많으셨습니다!!
calendarContainer={CalendarStyle} | ||
renderCustomHeader={(props) => ( | ||
<CustomHeader | ||
{...props} |
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
작업 내용 🧑💻
피그마의
modal_periodsetting_dashboard
를 만들었습니다!modal_datetimesetting_correction
는 별개의 컴포넌트로 이후 제작 예정입니다네비바 호버 되게 제작했습니다!
알게된 점 🚀
를 통해 범위를 지정해 stylelint 적용 x 할 수 있다는 걸 알게 됐습니다
DatePicker 가 children은 하단으로만 받는 것 같아서 캘린더 상단에 영역 커스텀하기 위해
속성을 찾아 사용했습니다 ,,
리뷰 요구사항 💬
중복 로직이나 조건별로 분기 잘 했는지, 잘 동작하는지 확인해주시면 감사하겠습니당
같은 날 막기 로직, 엣지케이스 막기, Placeholder 설정 관련해서는 디자인,기획파트 질문하고 답변 받으면 추가적으로 적용하겠습니다!
관련 이슈
close #49
스크린샷 (선택)