Skip to content

Commit 5e006a4

Browse files
committed
2 parents 9fc534a + 9f6bb67 commit 5e006a4

File tree

16 files changed

+236
-4
lines changed

16 files changed

+236
-4
lines changed

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Route, Routes } from 'react-router';
22

33
import useViewport from './hooks/useViewport';
4+
import Header from './layouts/Header';
45
import Home from './pages/Home';
56
import LetterBoardPage from './pages/LetterBoard';
67
import LetterBoardDetailPage from './pages/LetterBoardDetail';
@@ -34,7 +35,7 @@ const App = () => {
3435
<Route path="letter/:id" element={<LetterBoardDetailPage />} />
3536
<Route path="rolling/:id" element={<RollingPaperPage />} />
3637
</Route>
37-
<Route path="mypage">
38+
<Route path="mypage" element={<Header />}>
3839
<Route index element={<MyPage />} />
3940
<Route path="notifications" element={<NotificationsPage />} />
4041
</Route>

src/assets/icons/alarm.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/arrow-left.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import AlarmIcon from './alarm.svg?react';
2+
import ArrowLeftIcon from './arrow-left.svg?react';
3+
import PersonIcon from './person.svg?react';
4+
5+
export { AlarmIcon, PersonIcon, ArrowLeftIcon };

src/assets/icons/person.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/images/yellow-modal.png

228 KB
Loading

src/components/.gitkeep

Whitespace-only changes.

src/components/ConfirmModal.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import ModalBg from '@/assets/images/yellow-modal.png';
2+
3+
import ModalOverlay from './ModalOverlay';
4+
5+
interface ConfirmModalProps {
6+
title: string;
7+
description: string;
8+
cancelText: string;
9+
confirmText: string;
10+
children?: React.ReactNode;
11+
onCancel: () => void;
12+
onConfirm: () => void;
13+
}
14+
15+
const ConfirmModal = ({
16+
title,
17+
description,
18+
cancelText,
19+
confirmText,
20+
children,
21+
onCancel,
22+
onConfirm,
23+
}: ConfirmModalProps) => {
24+
// TODO: 배경 이미지 삽입
25+
// TODO: 전역 상태로 관리해야하는지 고민
26+
return (
27+
<ModalOverlay>
28+
<div className="w-73">
29+
<section className="relative mb-12 overflow-hidden rounded-lg p-5">
30+
<img src={ModalBg} className="absolute inset-0 z-[-10] h-full w-full" />
31+
<div className="flex flex-col gap-1">
32+
<p className="body-m text-gray-80">{title}</p>
33+
<p className="caption-r text-black">{description}</p>
34+
</div>
35+
{children}
36+
</section>
37+
<section className="flex items-center gap-6">
38+
<button
39+
type="button"
40+
className="body-m secondary-btn h-10 flex-1 basis-1/2"
41+
onClick={onCancel}
42+
>
43+
{cancelText}
44+
</button>
45+
<button
46+
type="button"
47+
className="primary-btn body-m h-10 flex-1 basis-1/2"
48+
onClick={onConfirm}
49+
>
50+
{confirmText}
51+
</button>
52+
</section>
53+
</div>
54+
</ModalOverlay>
55+
);
56+
};
57+
58+
export default ConfirmModal;

src/components/ModalOverlay.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
interface ModalOverlayProps {
2+
children: React.ReactElement;
3+
}
4+
5+
const ModalOverlay = ({ children }: ModalOverlayProps) => {
6+
return (
7+
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60">
8+
{children}
9+
</div>
10+
);
11+
};
12+
13+
export default ModalOverlay;

src/hooks/useViewport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { useEffect } from 'react';
33
function useViewport() {
44
useEffect(() => {
55
const setViewport = () => {
6-
const vh = window.innerHeight * 0.00999;
7-
const vw = document.documentElement.clientWidth * 0.00999;
6+
const vh = window.innerHeight * 0.01;
7+
const vw = document.documentElement.clientWidth * 0.01;
88
document.documentElement.style.setProperty('--vh', `${vh}px`);
99
document.documentElement.style.setProperty('--vw', `${vw}px`);
1010
};

0 commit comments

Comments
 (0)