Skip to content

Commit 232928c

Browse files
authored
Merge pull request #49 from prgrms-web-devcourse-final-project/fix/welcome
[fix] 환영팝업 경고 수정
2 parents 58fa232 + be43d85 commit 232928c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/app/login/Welcome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Welcome({ open, onClose }: Props) {
4747
>
4848
<div className="flex-center">
4949
<div className="relative w-32 h-32" aria-hidden>
50-
<Image src={Ssury} alt="" fill className="object-contain" />
50+
<Image src={Ssury} alt="" fill sizes="128px" className="object-contain" />
5151
</div>
5252
</div>
5353
</ModalLayout>

src/shared/components/modalPop/ModalLayout.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,26 @@ function ModalLayout({
3939
return () => document.removeEventListener('keydown', handleKeyDown);
4040
}, [open, onClose]);
4141

42+
// 팝업 열릴 시 scroll 막기
43+
useEffect(() => {
44+
if (open) document.body.style.overflow = 'hidden';
45+
else document.body.style.overflow = '';
46+
47+
return () => {
48+
document.body.style.overflow = '';
49+
};
50+
}, [open]);
51+
4252
if (!open) return null;
4353

4454
return (
4555
<Portal>
46-
<div className="fixed inset-0 bg-black/80 flex-center " onClick={onClose} aria-hidden="true">
56+
<div className="fixed inset-0 flex items-center justify-center w-full h-full">
57+
<div
58+
className="fixed inset-0 bg-primary/90 flex-center "
59+
onClick={onClose}
60+
aria-hidden="true"
61+
></div>
4762
<div
4863
className={tw(
4964
'relative w-[calc(100%-1.5rem)] p-8 rounded-lg bg-bg-pop shadow-[0_4px_9px_0_rgba(255,255,255,0.25)]',

0 commit comments

Comments
 (0)