Skip to content

Commit f7ca7a6

Browse files
committed
feat: 마이페이지에서 신고 횟수 클릭 시 신고 안내 모달이 뜨도록
1 parent ad9ef27 commit f7ca7a6

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/pages/MyPage/index.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ import useMyPageStore from '@/stores/myPageStore';
88

99
import { TEMPERATURE_RANGE } from './constants';
1010
import useToastStore from '@/stores/toastStore';
11+
import ModalOverlay from '@/components/ModalOverlay';
1112

1213
const MyPage = () => {
1314
useEffect(() => {
1415
fetchMyPageInfo();
1516
}, []);
1617

1718
const { data, fetchMyPageInfo } = useMyPageStore();
19+
1820
const [isOpenModal, setIsOpenModal] = useState(false);
21+
const [isOpenWarningModal, setIsOpenWarningModal] = useState(false);
22+
1923
const logout = useAuthStore((state) => state.logout);
2024
const setToastActive = useToastStore((state) => state.setToastActive);
2125

@@ -60,6 +64,25 @@ const MyPage = () => {
6064
}}
6165
/>
6266
)}
67+
68+
{isOpenWarningModal && (
69+
<ModalOverlay closeOnOutsideClick onClose={() => setIsOpenWarningModal(false)}>
70+
<article className="bg-accent-1 relative w-77 overflow-hidden rounded-sm p-6">
71+
<div className="absolute inset-0 h-full w-full bg-white/90 blur-[25px]" />
72+
<div className="relative">
73+
<h2 className="body-sb mb-1.5 text-gray-100">경고 규칙</h2>
74+
<p className="caption-r text-black">
75+
1회 경고: 주의 안내
76+
<br />
77+
2회 경고: 7일 동안 서비스 이용 제한
78+
<br />
79+
3회 경고: 서비스 이용 불가능
80+
</p>
81+
</div>
82+
</article>
83+
</ModalOverlay>
84+
)}
85+
6386
<main className="flex grow flex-col gap-12 px-5 pt-20 pb-6">
6487
<h1 className="h2-b mx-auto flex gap-1.5">
6588
{data.zipCode.split('').map((code, index) => (
@@ -109,12 +132,18 @@ const MyPage = () => {
109132
<span>{data.email}</span>
110133
</p>
111134
</div>
112-
<div className="flex justify-between">
135+
<div
136+
className="flex justify-between"
137+
onClick={async () => {
138+
setIsOpenWarningModal(true);
139+
}}
140+
>
113141
<p className="body-sb text-gray-100">경고 횟수</p>
114142
<p className="body-r text-gray-60">
115143
<span>{data.warningCount}</span>
116144
</p>
117145
</div>
146+
118147
<button
119148
className="body-sb self-start text-gray-100"
120149
onClick={() => {

0 commit comments

Comments
 (0)