Skip to content

Commit 5b621c3

Browse files
authored
Merge pull request #185 from Soohyuniii/feat/Header-고정-작업
feat: header 고정
2 parents c436e94 + 3f39a35 commit 5b621c3

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

src/components/header/Header.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ReactNode } from "react";
12
import { useLocation } from "react-router-dom";
23
import SubHeader from "@/components/header/SubHeader";
34
import MainHeader from "@/components/header/MainHeader";
@@ -7,25 +8,35 @@ type HeaderProps = {
78
title?: string;
89
showPreviousIcon?: boolean;
910
showShareIcon?: boolean;
11+
children?: ReactNode;
1012
};
1113

1214
const Header = ({
1315
title = "",
1416
showPreviousIcon = true,
15-
showShareIcon = false
17+
showShareIcon = false,
18+
children
1619
}: HeaderProps) => {
1720
const { pathname } = useLocation();
1821
const { isLoggedIn } = useAuthStore();
1922
const isHomepage = pathname === "/";
2023

21-
return isHomepage ? (
22-
<MainHeader isLoggedIn={isLoggedIn} />
23-
) : (
24-
<SubHeader
25-
title={title}
26-
showPreviousIcon={showPreviousIcon}
27-
showShareIcon={showShareIcon}
28-
/>
24+
return (
25+
<>
26+
<div className="fixed z-50 w-[360px] bg-white md:w-[375px] lg:w-[500px]">
27+
{isHomepage ? (
28+
<MainHeader isLoggedIn={isLoggedIn} />
29+
) : (
30+
<SubHeader
31+
title={title}
32+
showPreviousIcon={showPreviousIcon}
33+
showShareIcon={showShareIcon}
34+
/>
35+
)}
36+
</div>
37+
38+
<div className="pt-14">{children}</div>
39+
</>
2940
);
3041
};
3142

src/components/modal/ActionConfirmModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ const ActionConfirmModal = ({
1919
}: AlertProps) => {
2020
return (
2121
<div
22-
className="absolute inset-0 z-50 flex items-center justify-center bg-black/50"
22+
className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
2323
onClick={onCancel}
2424
>
25-
<div className="flex h-[200px] w-[294px] flex-col items-center justify-center rounded-2xl bg-white">
25+
<div
26+
className="flex h-[200px] w-[294px] flex-col items-center justify-center rounded-2xl bg-white"
27+
onClick={(e) => e.stopPropagation()}
28+
>
2629
<h3 className="text-2xl font-bold">{title}</h3>
2730
<p className="mt-[9px] text-center text-xl font-medium">
2831
{message.map((line, index) => (

0 commit comments

Comments
 (0)