-
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] weekly 퍼블리싱 #56
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2a763d4
feat: fullCalendar 라이브러리 설치
seong-hui 1675ab7
style: fullcalendar css custom
seong-hui 8afe2cf
feat: en dateTimeFormat
seong-hui f2798f1
style: 캘린더 버튼 style 설정
seong-hui f491f02
style: calendar font-size 변경
seong-hui 2db3645
style: button 간격 수정
seong-hui 64785dc
style: day에서는 주말 배경색 변경 안되게 하기
seong-hui c386be5
feat: 주간, 월간에 따라 dayHeaderContent 변경
seong-hui 108c302
feat: 일간, 주간, 월간, 레이아웃 구현
seong-hui bd472f9
feat: 타입별 날짜 보여주기 분기
seong-hui 3a2af89
feat: 종일 이벤트, 시간 이벤트 색 구별
seong-hui 34fc29c
fix: 종일, 그외 이벤트 구별해서 스타일 적용
seong-hui baa1b12
feat: 상단 날짜표시 컴포넌트 분리
seong-hui f7b9b51
feat: 동기화 버튼 추가
seong-hui 5453d25
feat: 달력 날짜에서 일빼고 숫자만 넣는 기능 구현
seong-hui c169e36
feat: 이벤트 시간 형식 변경
seong-hui e25177e
style: 캘린더 색상 theme 적용
seong-hui 064d8a0
fix: 폴더구조 및 이름 변경
seong-hui 3ed6623
delete: 중복 동기화 아이콘 삭제
seong-hui 93ba7c2
style: 기본 버튼 색상 변경
seong-hui 81c2c10
fix: style props로 색상변경 로직 수정
seong-hui ab0870b
fix: theme 적용
seong-hui a410971
fix: fullcalendar util함수 분리
seong-hui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import styled from '@emotion/styled'; | ||
import { DayHeaderContentArg } from '@fullcalendar/core'; | ||
|
||
interface DayHeaderContentProps { | ||
arg: DayHeaderContentArg; | ||
currentView: string; | ||
today: string; | ||
} | ||
|
||
function DayHeaderContent({ arg, currentView, today }: DayHeaderContentProps) { | ||
const isTimeGridDay = currentView === 'timeGridDay'; | ||
const day = new Intl.DateTimeFormat('en-US', { weekday: isTimeGridDay ? 'long' : 'short' }).format(arg.date); | ||
const date = arg.date.getDate(); | ||
const isToday = arg.date.toDateString() === today; | ||
|
||
return ( | ||
<div> | ||
{!isTimeGridDay ? ( | ||
<> | ||
<WeekDay isToday={isToday}>{day}</WeekDay> | ||
{currentView !== 'dayGridMonth' && <WeekDate isToday={isToday}>{date}</WeekDate>} | ||
</> | ||
) : ( | ||
<DayLayout> | ||
<WeekDate isToday={false}>{date}일</WeekDate> <WeekDay isToday={false}>{day}</WeekDay> | ||
</DayLayout> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
const DayLayout = styled.div` | ||
display: flex; | ||
gap: 1.2rem; | ||
align-items: flex-end; | ||
margin-left: 0.8rem; | ||
`; | ||
|
||
const WeekDay = styled.div<{ isToday: boolean }>` | ||
${({ theme }) => theme.fontTheme.CAPTION_02}; | ||
color: ${({ isToday, theme }) => (isToday ? theme.palette.Blue.Blue11 : theme.palette.Grey.Grey6)}; | ||
text-transform: uppercase; | ||
`; | ||
|
||
const WeekDate = styled.div<{ isToday: boolean }>` | ||
${({ theme }) => theme.fontTheme.HEADLINE_01}; | ||
color: ${({ isToday, theme }) => (isToday ? theme.palette.Primary : theme.palette.Grey.Black)}; | ||
`; | ||
|
||
export default DayHeaderContent; |
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,108 @@ | ||
import styled from '@emotion/styled'; | ||
import { ViewMountArg, DatesSetArg } from '@fullcalendar/core'; | ||
import dayGridPlugin from '@fullcalendar/daygrid'; | ||
import interactionPlugin from '@fullcalendar/interaction'; | ||
import FullCalendar from '@fullcalendar/react'; | ||
import timeGridPlugin from '@fullcalendar/timegrid'; | ||
import { useState } from 'react'; | ||
|
||
import RefreshBtn from '@/components/common/button/RefreshBtn'; | ||
import DayHeaderContent from '@/components/common/fullCalendar/DayHeaderContent'; | ||
import FullCalendarLayout from '@/components/common/fullCalendar/FullCalendarStyle'; | ||
import { customDayCellContent, customSlotLabelContent } from '@/components/common/fullCalendar/fullCalendarUtils'; | ||
import { theme } from '@/styles/theme'; | ||
|
||
interface FullCalendarBoxProps { | ||
size: 'small' | 'big'; | ||
} | ||
|
||
function FullCalendarBox({ size }: FullCalendarBoxProps) { | ||
const today = new Date().toDateString(); | ||
const [currentView, setCurrentView] = useState('timeGridWeek'); | ||
|
||
const handleViewChange = (view: ViewMountArg) => { | ||
setCurrentView(view.view.type); | ||
}; | ||
|
||
const handleDatesSet = (dateInfo: DatesSetArg) => { | ||
setCurrentView(dateInfo.view.type); | ||
}; | ||
|
||
return ( | ||
<FullCalendarLayout size={size}> | ||
<CustomButtonContainer> | ||
<RefreshBtn isDisabled={false} /> | ||
</CustomButtonContainer> | ||
<FullCalendar | ||
initialView="timeGridWeek" | ||
plugins={[timeGridPlugin, dayGridPlugin, interactionPlugin]} | ||
headerToolbar={{ | ||
left: 'title today prev next timeGridDay,timeGridWeek,dayGridMonth', | ||
right: '', | ||
}} | ||
views={{ | ||
timeGridDay: { | ||
titleFormat: { year: 'numeric', month: 'short' }, | ||
}, | ||
timeGridWeek: { | ||
titleFormat(date) { | ||
return `${date.date.year}년 ${date.date.month + 1}월`; | ||
}, | ||
}, | ||
dayGridMonth: { | ||
titleFormat: { year: 'numeric', month: 'short' }, | ||
}, | ||
}} | ||
slotDuration="00:30:00" | ||
editable | ||
selectable | ||
nowIndicator | ||
dayMaxEvents | ||
events={[ | ||
{ title: 'Meeting', start: '2024-07-06T10:00:00', end: '2024-07-06T12:00:00' }, | ||
{ title: 'Lunch', start: '2024-07-07T12:00:00', end: '2024-07-07T12:45:00' }, | ||
{ title: 'Lunch', start: '2024-07-08T12:00:00', end: '2024-07-08T12:30:00' }, | ||
{ title: 'All Day Event', start: '2024-07-08T10:00:00', end: '2024-07-08T12:00:00', allDay: true }, | ||
]} | ||
eventColor={theme.palette.Blue.Blue2} | ||
buttonText={{ | ||
today: '오늘', | ||
month: '월간', | ||
week: '주간', | ||
day: '일간', | ||
}} | ||
allDayText="종일" | ||
locale="ko" | ||
slotLabelFormat={{ | ||
hour: 'numeric', | ||
minute: '2-digit', | ||
meridiem: 'short', | ||
hour12: true, | ||
}} | ||
slotLabelContent={customSlotLabelContent} | ||
/* eslint-disable */ | ||
dayHeaderContent={(arg) => <DayHeaderContent arg={arg} currentView={currentView} today={today} />} | ||
viewDidMount={handleViewChange} | ||
datesSet={handleDatesSet} | ||
dayCellContent={customDayCellContent} | ||
eventTimeFormat={{ | ||
hour: 'numeric', | ||
minute: '2-digit', | ||
hour12: false, | ||
}} | ||
/> | ||
</FullCalendarLayout> | ||
); | ||
} | ||
|
||
const CustomButtonContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
box-sizing: border-box; | ||
width: 100%; | ||
margin-bottom: -2.6rem; | ||
padding-right: 1rem; | ||
`; | ||
|
||
export default FullCalendarBox; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
네넹 이 부분은 Props로 받아서 처리하면 됩니당!