Skip to content

Commit 54238fd

Browse files
authored
Merge branch 'dev' into 24-add-new-event
2 parents 5416dcc + c0925ff commit 54238fd

File tree

6 files changed

+137
-52
lines changed

6 files changed

+137
-52
lines changed

โ€Žsrc/components/common/Calendar.tsxโ€Ž

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,50 @@ const Calendar: React.FC = () => {
2525
}
2626
};
2727

28+
// eslint-disable-next-line react-hooks/exhaustive-deps
29+
const updateSize = () => {
30+
const isMobile = window.innerWidth < 768;
31+
setCalendarHeight(isMobile ? 500 : 'auto');
32+
updateTitle();
33+
};
34+
35+
const updateTitle = () => {
36+
const calendarApi = calendarRef?.current?.getApi();
37+
if (calendarApi) {
38+
const calendarView = calendarApi.view;
39+
40+
const date = new Date(calendarView.currentStart);
41+
const year = date.getFullYear();
42+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
43+
const newTitle = `${year}.${month}`;
44+
45+
const titleElement = document.querySelector('.fc-toolbar-title');
46+
if (titleElement) {
47+
titleElement.textContent = newTitle;
48+
}
49+
}
50+
};
51+
2852
useEffect(() => {
29-
const updateSize = () => {
30-
const isMobile = window.innerWidth < 768;
31-
setCalendarHeight(isMobile ? 500 : 'auto');
32-
};
53+
const calendarApi = calendarRef?.current?.getApi();
54+
55+
if (calendarApi) {
56+
calendarApi.on('datesSet', updateTitle);
57+
}
58+
59+
updateTitle(); // ์ปดํฌ๋„ŒํŠธ ๋งˆ์šดํŠธ ์‹œ ์ œ๋ชฉ ์—…๋ฐ์ดํŠธ
3360

61+
/* ์บ˜๋ฆฐ๋” - ๋ฐ˜์‘ํ˜• ์‚ฌ์ด์ฆˆ */
3462
window.addEventListener('resize', updateSize);
35-
updateSize();
63+
updateSize(); // ์ปดํฌ๋„ŒํŠธ ๋งˆ์šดํŠธ ์‹œ ํ™”๋ฉด ํฌ๊ธฐ์— ๋”ฐ๋ฅธ ์—…๋ฐ์ดํŠธ
3664

37-
return () => window.removeEventListener('resize', updateSize);
38-
}, []);
65+
return () => {
66+
window.removeEventListener('resize', updateSize);
67+
if (calendarApi) {
68+
calendarApi.off('datesSet', updateTitle);
69+
}
70+
};
71+
}, [updateSize]);
3972

4073
const events = useEventState();
4174
return (
@@ -53,6 +86,10 @@ const Calendar: React.FC = () => {
5386
titleFormat={{
5487
year: 'numeric',
5588
month: '2-digit',
89+
}}
90+
eventTimeFormat={{
91+
hour: '2-digit',
92+
minute: '2-digit',
5693
meridiem: false,
5794
}}
5895
dayHeaderFormat={{
@@ -65,11 +102,9 @@ const Calendar: React.FC = () => {
65102
}}
66103
customButtons={{
67104
prevButton: {
68-
icon: 'chevron-left',
69105
click: handlePrev,
70106
},
71107
nextButton: {
72-
icon: 'chevron-right',
73108
click: handleNext,
74109
},
75110
}}
@@ -88,8 +123,10 @@ interface EventInfo {
88123
function renderEventContent(eventInfo: EventInfo) {
89124
return (
90125
<>
91-
<b>{eventInfo.timeText}</b>
92-
<i>{eventInfo.event.title}</i>
126+
<div className="w-full border-0 bg-secondary p-0.5 text-white">
127+
<b className="border-0">{eventInfo.timeText}</b>
128+
<i> {eventInfo.event.title}</i>
129+
</div>
93130
</>
94131
);
95132
}
563 Bytes
Loading
553 Bytes
Loading

โ€Žsrc/main.tsxโ€Ž

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,61 @@ import UserInvite from './components/common/UserInvite.tsx';
1414
const router = createBrowserRouter([
1515
{
1616
path: '/',
17-
element: (
18-
<ProtectedRoute>
19-
<App />
20-
</ProtectedRoute>
21-
),
22-
},
23-
{
24-
path: '/login',
25-
element: <LoginPage />,
26-
},
27-
{
28-
path: '/join',
29-
element: <JoinPage />,
30-
},
31-
{
32-
path: '/editPw',
33-
element: <ResetPwPage />,
34-
},
35-
{
36-
path: '/change-password',
37-
element: <ChangePasswordPage />,
38-
},
39-
{
40-
path: '*',
41-
element: <NotFound />,
42-
},
43-
{
44-
path: '/test',
4517
children: [
4618
{
47-
path: 'inputForm',
48-
element: <TextInputForm />,
19+
index: true,
20+
element: (
21+
<ProtectedRoute>
22+
<App />
23+
</ProtectedRoute>
24+
),
4925
},
26+
5027
{
51-
path: 'UserInvite',
52-
element: <UserInvite />,
28+
path: '/login',
29+
element: <LoginPage />,
30+
},
31+
{
32+
path: '/join',
33+
element: <JoinPage />,
34+
},
35+
{
36+
path: '/editPw',
37+
element: <ResetPwPage />,
38+
},
39+
{
40+
path: '/change-password',
41+
element: <ChangePasswordPage />,
42+
},
43+
{
44+
path: '*',
45+
element: <NotFound />,
5346
},
54-
],
55-
},
56-
{
57-
path: '/policy',
58-
children: [
5947
{
60-
path: 'personalInfo',
61-
element: <Policy.PersonalInfoPage />,
48+
path: '/test',
49+
children: [
50+
{
51+
path: 'inputForm',
52+
element: <TextInputForm />,
53+
},
54+
{
55+
path: 'UserInvite',
56+
element: <UserInvite />,
57+
},
58+
],
6259
},
6360
{
64-
path: 'usecondition',
65-
element: <Policy.UseConditionPage />,
61+
path: '/policy',
62+
children: [
63+
{
64+
path: 'personalInfo',
65+
element: <Policy.PersonalInfoPage />,
66+
},
67+
{
68+
path: 'usecondition',
69+
element: <Policy.UseConditionPage />,
70+
},
71+
],
6672
},
6773
],
6874
},

โ€Žsrc/styles/index.cssโ€Ž

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@tailwind components;
33
@tailwind utilities;
44

5+
56
.userInvite {
67
display: flex;
78
justify-content: center;
@@ -32,3 +33,39 @@
3233
visibility: visible;
3334
}
3435
}
36+
37+
@layer base {
38+
@font-face {
39+
font-family: 'Pretendard-Regular';
40+
src: url('https://fastly.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff') format('woff');
41+
font-weight: 400;
42+
font-style: normal;
43+
}
44+
}
45+
46+
/* ์บ˜๋ฆฐ๋” - ํ™”์‚ดํ‘œ ์•„์ด์ฝ˜ */
47+
.fc .fc-button-primary:hover {
48+
background-color: var(--fc-event-text-color);
49+
}
50+
.fc .fc-prevButton-button {
51+
background-color: transparent;
52+
border: 0;
53+
background-image: url('../img/icon_arrow_left.png');
54+
width: 20px;
55+
height: 20px;
56+
display: block;
57+
background-size: contain;
58+
}
59+
.fc .fc-nextButton-button {
60+
background-color: transparent;
61+
border: 0;
62+
background-image: url('../img/icon_arrow_right.png');
63+
width: 20px;
64+
height: 20px;
65+
display: block;
66+
background-size: contain;
67+
}
68+
/* ์บ˜๋ฆฐ๋” - ์ผ์ •์ปฌ๋Ÿฌ */
69+
.fc .fc-h-event {
70+
border: var(--fc-event-text-color);
71+
}

โ€Žtailwind.config.jsโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export default {
66
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
77
theme: {
88
extend: {},
9+
fontFamily: {
10+
sans: ['Pretendard-Regular', 'sans-serif'],
11+
serif: ['Pretendard-Regular', 'sans-serif'],
12+
mono: ['Pretendard-Regular', 'sans-serif'],
13+
},
914
},
1015

1116
daisyui: {

0 commit comments

Comments
ย (0)