Skip to content

Commit 673cd39

Browse files
committed
refactor(#136): 마이페이지 레이아웃에서 Header UI를 별도 컴포넌트로 분리
1 parent 9238767 commit 673cd39

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { style } from "@vanilla-extract/css";
2+
3+
import { semantic } from "@/styles";
4+
5+
export const button = style({
6+
width: "2.4rem",
7+
height: "2.4rem",
8+
display: "flex",
9+
justifyContent: "center",
10+
alignItems: "center",
11+
});
12+
13+
export const icon = style({
14+
color: semantic.icon.black,
15+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use client";
2+
3+
import { useRouter } from "next/navigation";
4+
5+
import ChevronLeftIcon from "@/assets/chevron-left.svg";
6+
import { GNB } from "@/components/ui/GNB";
7+
8+
import * as styles from "./Header.css";
9+
10+
export const Header = () => {
11+
const router = useRouter();
12+
13+
const handleClick = () => {
14+
router.push("/");
15+
};
16+
17+
return (
18+
<GNB
19+
align='center'
20+
title='마이페이지'
21+
leftAddon={
22+
<button
23+
type='button'
24+
onClick={handleClick}
25+
aria-label='홈으로 이동하기'
26+
className={styles.button}
27+
>
28+
<ChevronLeftIcon
29+
width={24}
30+
height={24}
31+
onClick={handleClick}
32+
className={styles.icon}
33+
/>
34+
</button>
35+
}
36+
/>
37+
);
38+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { Header } from "./Header";

0 commit comments

Comments
 (0)