Skip to content

Commit ad43918

Browse files
committed
Merge branch 'dev' of https://github.com/imaginer-dev/DateLeaf into 29-๊ทธ๋ฃน-์ผ์ •๊ณผ-๊ด€๋ จ๋œ-๋ฐ์ดํ„ฐ๋ฅผ-์ˆ˜์ •ํ• -์ˆ˜-์žˆ์–ด์•ผํ•œ๋‹ค
2 parents 6ddb12c + c0925ff commit ad43918

File tree

7 files changed

+160
-54
lines changed

7 files changed

+160
-54
lines changed

โ€Žsrc/App.tsxโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function App() {
2727
</label>
2828
</div>
2929
<div className="flex-1">
30-
<h1 className="base-200 min-w-40 p-2 text-center">๊ฐœ์ธ ์ผ์ • ์บ˜๋ฆฐ๋”</h1>
30+
<h1 className="flex-end min-w-40 rounded bg-base-200 p-2 text-center text-sm">๊ฐœ์ธ ์ผ์ • ์บ˜๋ฆฐ๋”</h1>
3131
</div>
3232
</div>
3333
</div>
@@ -46,7 +46,7 @@ function App() {
4646
</div>
4747
</header>
4848
<main className="z-1 relative flex-grow">
49-
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
49+
<div className="ml-auto max-w-7xl px-4 sm:px-6 lg:px-8">
5050
<div className="rounded bg-white p-6 px-4 sm:px-0">
5151
<Calendar />
5252
</div>

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

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,50 @@ export function Calendar() {
3131
}
3232
};
3333

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

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

43-
return () => window.removeEventListener('resize', updateSize);
44-
}, []);
71+
return () => {
72+
window.removeEventListener('resize', updateSize);
73+
if (calendarApi) {
74+
calendarApi.off('datesSet', updateTitle);
75+
}
76+
};
77+
}, [updateSize]);
4578

4679
return (
4780
<div>
@@ -58,6 +91,10 @@ export function Calendar() {
5891
titleFormat={{
5992
year: 'numeric',
6093
month: '2-digit',
94+
}}
95+
eventTimeFormat={{
96+
hour: '2-digit',
97+
minute: '2-digit',
6198
meridiem: false,
6299
}}
63100
dayHeaderFormat={{
@@ -70,11 +107,9 @@ export function Calendar() {
70107
}}
71108
customButtons={{
72109
prevButton: {
73-
icon: 'chevron-left',
74110
click: handlePrev,
75111
},
76112
nextButton: {
77-
icon: 'chevron-right',
78113
click: handleNext,
79114
},
80115
}}
@@ -93,8 +128,10 @@ interface EventInfo {
93128
function renderEventContent(eventInfo: EventInfo) {
94129
return (
95130
<>
96-
<b>{eventInfo.timeText}</b>
97-
<i>{eventInfo.event.title}</i>
131+
<div className="w-full border-0 bg-secondary p-0.5 text-white">
132+
<b className="border-0">{eventInfo.timeText}</b>
133+
<i> {eventInfo.event.title}</i>
134+
</div>
98135
</>
99136
);
100137
}
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: 58 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;
@@ -11,3 +12,60 @@
1112
border: 1px solid oklch(var(--b3));
1213
border-radius: 0.5rem;
1314
}
15+
16+
@media (min-width: 1024px) {
17+
.drawer-toggle {
18+
display: none;
19+
}
20+
.drawer-content {
21+
flex-direction: row;
22+
}
23+
.drawer-side {
24+
width: 15%;
25+
visibility: visible;
26+
overflow-y: auto;
27+
}
28+
.drawer-side > *:not(.drawer-overlay) {
29+
transform: translateX(0%);
30+
}
31+
32+
.drawer-overlay {
33+
visibility: visible;
34+
}
35+
}
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)