-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 날짜만 선택 기능 추가에 의한 약속 생성 데이터 타입 추가 * feat(useMeetingType): 체크 상태에 따른 미팅 타입 판별 커스텀 훅 구현 * test(useMeetingType): 로직 검증 테스트 케이스 추가 * refactor: 약속 생성 페이지에 날짜만 선택하는 체크박스 기능 및 UI 구현 * feat: 모달 컴포넌트 구현 * test(ConfirmModal): 스토리북 작성 * refactor(useMeetingType): 파일 확장자 수정 * refactor: 모달 z-index 추가 및 content prop -> children으로 수정 * refactor(groupDates): 로직 및 반환값 수정 * feat: useConfirmModal 훅 구현 * feat(CopyLink): 컴포넌트 분리 * refactor: 입력한 약속 확인 방식 수정 및 CopyLink 컴포넌트 교체 * refactor: Calendar 이름 수정 * refactor: 툴팁 스타일 수정 * refactor: 날짜 비활성화 css 네이밍 수정 * feat(useMeetingConfirmCalendar): 날짜만 선택 시 약속 조회 훅 구현 * feat(MeetingConfirmCalendar): MeetingCalendar 기반 날짜 조회, 등록 컴포넌트 구현 * test(MeetingConfirmCalendar): 달력 기반 날짜 조회, 수정 컴포넌트 스토리북 작성 * refactor(meetingType): 타입 대문자로 수정 * test: 목 데이터 추가 및 API 요청 및 약속 수정 요청 로직 추가 * refactor: useQuery 레이어 분리 * fix: 바뀐 변수명 적용(isPrevDate -> isDisabledDate) * refactor: useMeetingConfirmCalendar -> useCalendarPick으로 훅 네이밍 수정 및 로직 변경 * refactor(MeetingConfirmCalendar): 기존 로직 삭제 후 Picker, Viewer 구분하여 재구성 * feat: 날짜만 선택했을 때 추천해주는 옵션 카드 컴포넌트 구현 * refactor: type이 필요한 api 요청에 타입 추가 및 추가한 타입을 반영한 로직으로 수정 * refactor: 추천 데이터 타입 수정 및 끝 시간 표기 추가 * refactor: 시간 셀 position relative로 변경 * refactor: 달력 감싸는 컨테이너 요소 flex 추가 * refactor: 날짜만 선택 시, 시간 제외 컴포넌트 구현 * refactor: 약속 날짜 선택 -> 약속 후보 날짜 선택으로 텍스트 수정 * refactor: 단일 선택 날짜 조회 시, 선택된 날짜 체크 이미지로 표현 * refactor: 목데이터 타입 추가, 수정 * refactor: 약속 후보 날짜 선택 필드에 설명 추가 * refactor(CopyLink): 폴더명 수정 * refactor: Checkbox 공통 컴포넌트로 교체
- Loading branch information
Showing
64 changed files
with
1,659 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
frontend/src/components/MeetingConfirmCalendar/Header/Header.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
export const s_container = css` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 3.6rem; | ||
margin-bottom: 1rem; | ||
`; |
48 changes: 48 additions & 0 deletions
48
frontend/src/components/MeetingConfirmCalendar/Header/Header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { | ||
s_monthNavigation, | ||
s_monthNavigationContainer, | ||
s_yearMonthText, | ||
} from '@components/MeetingCalendar/Header/MeetingCalendarHeader.styles'; | ||
|
||
import { s_container } from './Header.styles'; | ||
|
||
// 해당 인터페이스 기본 CalendarHeader에서도 사용되는데 통합되는 것이 좋아보입니다.(@낙타) | ||
interface HeaderProps { | ||
currentYear: number; | ||
currentMonth: number; | ||
moveToNextMonth: () => void; | ||
moveToPrevMonth: () => void; | ||
isCurrentMonth?: boolean; | ||
} | ||
|
||
// CSS는 대부분 MeetingCalendar를 이용했습니다. | ||
// 추후 리팩터링을 진행할 때, '<'버튼과 '>' 버튼을 없앨지 고민중인데, 로직 분기 고민 + 일관된 사용성을 위해서 유지하기로 결정했습니다.(@낙타) | ||
export default function Header({ | ||
currentYear, | ||
currentMonth, | ||
moveToNextMonth, | ||
moveToPrevMonth, | ||
isCurrentMonth, | ||
}: HeaderProps) { | ||
return ( | ||
<header css={s_container}> | ||
<div css={s_monthNavigationContainer}> | ||
<button | ||
css={s_monthNavigation} | ||
onClick={moveToPrevMonth} | ||
aria-label="지난 달" | ||
disabled={isCurrentMonth} | ||
> | ||
{'<'} | ||
</button> | ||
|
||
<span css={s_yearMonthText}> | ||
{currentYear}년 {currentMonth + 1}월 | ||
</span> | ||
<button css={s_monthNavigation} onClick={moveToNextMonth} aria-label="다음 달"> | ||
{'>'} | ||
</button> | ||
</div> | ||
</header> | ||
); | ||
} |
86 changes: 86 additions & 0 deletions
86
frontend/src/components/MeetingConfirmCalendar/Picker/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { useContext } from 'react'; | ||
import { useParams } from 'react-router-dom'; | ||
|
||
import { AuthContext } from '@contexts/AuthProvider'; | ||
import { TimePickerUpdateStateContext } from '@contexts/TimePickerUpdateStateProvider'; | ||
|
||
import { | ||
s_bottomFixedButtonContainer, | ||
s_fullButtonContainer, | ||
} from '@components/Schedules/Schedules.styles'; | ||
import { Button } from '@components/_common/Buttons/Button'; | ||
import Calendar from '@components/_common/Calendar'; | ||
|
||
import useCalendarPick from '@hooks/useCalendarPick/useCalendarPick'; | ||
|
||
import { usePostScheduleMutation } from '@stores/servers/schedule/mutations'; | ||
|
||
import { getFullDate } from '@utils/date'; | ||
|
||
import Header from '../Header/Header'; | ||
import SingleDate from '../SingleDate/SingleDate'; | ||
import WeekDays from '../WeekDays'; | ||
|
||
interface PickerProps { | ||
availableDates: string[]; | ||
} | ||
|
||
export default function Picker({ availableDates }: PickerProps) { | ||
const params = useParams<{ uuid: string }>(); | ||
const uuid = params.uuid!; | ||
const { userName } = useContext(AuthContext).state; | ||
|
||
const { handleToggleIsTimePickerUpdate } = useContext(TimePickerUpdateStateContext); | ||
|
||
const { selectedDates, hasDate, handleSelectedDate } = useCalendarPick(uuid, userName); | ||
|
||
const { mutate: postScheduleMutate, isPending } = usePostScheduleMutation(() => | ||
handleToggleIsTimePickerUpdate(), | ||
); | ||
|
||
// 백엔드에 날짜 데이터 보내주기 위해 임시로 generate함수 선언(@낙타) | ||
const generateScheduleTable = (dates: string[]) => { | ||
return dates.map((date) => { | ||
return { | ||
date, | ||
times: ['00:00'], | ||
}; | ||
}); | ||
}; | ||
|
||
const handleOnToggle = () => { | ||
postScheduleMutate({ uuid, requestData: generateScheduleTable(selectedDates) }); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Calendar> | ||
<Calendar.Header render={(props) => <Header {...props} />} /> | ||
<Calendar.WeekDays render={(weekdays) => <WeekDays weekdays={weekdays} />} /> | ||
<Calendar.Body | ||
renderDate={(dateInfo, today) => ( | ||
<SingleDate | ||
key={dateInfo.key} | ||
isAvailable={availableDates.includes(getFullDate(dateInfo.value))} | ||
dateInfo={dateInfo} | ||
today={today} | ||
hasDate={hasDate} | ||
onDateClick={handleSelectedDate} | ||
/> | ||
)} | ||
/> | ||
</Calendar> | ||
|
||
<footer css={s_bottomFixedButtonContainer}> | ||
<div css={s_fullButtonContainer}> | ||
<Button size="full" variant="secondary" onClick={handleToggleIsTimePickerUpdate}> | ||
취소하기 | ||
</Button> | ||
<Button size="full" variant="primary" onClick={handleOnToggle} isLoading={isPending}> | ||
등록하기 | ||
</Button> | ||
</div> | ||
</footer> | ||
</> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
frontend/src/components/MeetingConfirmCalendar/SingleDate/SingleDate.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import theme from '@styles/theme'; | ||
|
||
export const s_additionalText = css` | ||
${theme.typography.captionBold} | ||
color: ${theme.colors.black} | ||
`; | ||
|
||
export const s_viewer = css` | ||
background-color: transparent; | ||
`; |
Oops, something went wrong.