Skip to content

Commit 51dd1b8

Browse files
committed
feat : 공유 알림, 편지 도착 알림 모달UI 작업
1 parent c3e4a84 commit 51dd1b8

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

src/pages/Notifications/components/SendingModal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import LetterWrapper from '@/components/LetterWrapper';
22
import ModalOverlay from '@/components/ModalOverlay';
33
import { useNavigate } from 'react-router';
4+
import SendOutlinedIcon from '@mui/icons-material/SendOutlined';
45

56
export default function SendingModal({
67
isOpenSendingModal,
@@ -21,7 +22,13 @@ export default function SendingModal({
2122
<div className="caption-r flex flex-col gap-2">
2223
<h2 className="body-b mb-3">편지 도착</h2>
2324
<span>편지는 작성된 시점으로 1시간 이후에 도착합니다.</span>
24-
<span>남은시간은 홈 화면의 편지 도착 시간 버튼을 눌러 확인 가능합니다.</span>
25+
<div className="flex flex-col">
26+
<div className="flex items-center gap-1">
27+
<span>남은시간은 홈 화면의 편지 도착 시간 버튼 </span>
28+
<SendOutlinedIcon fontSize="small" />
29+
</div>
30+
<span>을 눌러 확인 가능합니다.</span>
31+
</div>
2532
<button
2633
className="body-b mt-3 flex items-center justify-center"
2734
onClick={() => navigate('/')}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import LetterWrapper from '@/components/LetterWrapper';
2+
import ModalOverlay from '@/components/ModalOverlay';
3+
import { useNavigate } from 'react-router';
4+
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined';
5+
6+
export default function ShareModal({
7+
isOpenShareModal,
8+
setIsOpenShareModal,
9+
}: {
10+
isOpenShareModal: boolean;
11+
setIsOpenShareModal: React.Dispatch<React.SetStateAction<boolean>>;
12+
}) {
13+
const navigate = useNavigate();
14+
if (!isOpenShareModal) return null;
15+
const onClose = () => {
16+
setIsOpenShareModal(false);
17+
};
18+
return (
19+
<>
20+
<ModalOverlay closeOnOutsideClick onClose={onClose}>
21+
<LetterWrapper className="w-77">
22+
<div className="caption-r flex flex-col gap-2">
23+
<h2 className="body-b mb-3">편지 공유</h2>
24+
<span>따숨이님과의 편지를 공유하고 싶어합니다!</span>
25+
<div className="flex flex-col">
26+
<div className="flex items-center gap-1">
27+
<span>공유 요청은 홈 화면의 편지 공유 버튼 </span>
28+
<ShareOutlinedIcon fontSize="small" />
29+
</div>
30+
<span>을 눌러 확인 가능합니다.</span>
31+
</div>
32+
<button
33+
className="body-b mt-3 flex items-center justify-center"
34+
onClick={() => navigate('/')}
35+
>
36+
홈 화면으로 이동 {'>'}
37+
</button>
38+
</div>
39+
</LetterWrapper>
40+
</ModalOverlay>
41+
</>
42+
);
43+
}

src/pages/Notifications/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import NotificationItem from './components/NotificationItem';
88
import WarningModal from './components/WarningModal';
99
import SendingModal from './components/SendingModal';
1010
import useNotificationStore from '@/stores/notificationStore';
11+
import ShareModal from './components/ShareModal';
1112

1213
const NotificationsPage = () => {
1314
const navigate = useNavigate();
@@ -19,6 +20,7 @@ const NotificationsPage = () => {
1920

2021
const [isOpenWarningModal, setIsOpenWarningModal] = useState(false);
2122
const [isOpenSendingModal, setIsOpenSendingModal] = useState(false);
23+
const [isOpenShareModal, setIsOpenShareModal] = useState(false);
2224

2325
const [reportContent, setReportContent] = useState<string>('');
2426

@@ -35,7 +37,7 @@ const NotificationsPage = () => {
3537
if (typeof content === 'string') setReportContent(content);
3638
}
3739
if (alarmType === 'SHARE') {
38-
navigate(`/board/letter/${content}`, { state: { isShareLetterPreview: true } });
40+
setIsOpenShareModal(true);
3941
}
4042
if (alarmType === 'POSTED') {
4143
navigate(`/board/letter/${content}`);
@@ -99,6 +101,7 @@ const NotificationsPage = () => {
99101
isOpenSendingModal={isOpenSendingModal}
100102
setIsOpenSendingModal={setIsOpenSendingModal}
101103
/>
104+
<ShareModal isOpenShareModal={isOpenShareModal} setIsOpenShareModal={setIsOpenShareModal} />
102105
<main className="flex grow flex-col items-center px-5 pt-20 pb-9">
103106
<PageTitle className="mb-10">알림</PageTitle>
104107
<button

0 commit comments

Comments
 (0)