Skip to content

Commit 00ef97b

Browse files
committed
feat: 공통 네브바 및 네브바 구현
1 parent 1bf0178 commit 00ef97b

File tree

15 files changed

+324
-18
lines changed

15 files changed

+324
-18
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.ReceiptEdit {
2+
padding-left: 1.25rem;
3+
padding-right: 1.25rem;
4+
padding-bottom: 2.5rem;
5+
height: calc(100vh - 2.75rem);
6+
overflow: hidden;
7+
position: relative;
8+
display: flex;
9+
flex-direction: column;
10+
justify-content: space-between;
11+
background: var(--color-bg-gradient);
12+
}
13+
.ReceiptEdit::before {
14+
content: "";
15+
background: url("/src/assets/svg/img-graphic-main.svg") center no-repeat;
16+
background-size: 100% 16.375rem;
17+
filter: blur(4.625rem);
18+
position: absolute;
19+
top: 0;
20+
left: 0;
21+
right: 0;
22+
bottom: 0;
23+
z-index: 0;
24+
}
25+
26+
.Top {
27+
z-index: 1;
28+
}
29+
.Top .TitleBox {
30+
display: flex;
31+
justify-content: center;
32+
margin-top: 2.5rem;
33+
}
34+
35+
.InfoList {
36+
display: flex;
37+
flex-direction: column;
38+
gap: 0.875rem;
39+
margin-top: 1.5rem;
40+
}
41+
42+
.InfoItem {
43+
display: flex;
44+
flex-direction: column;
45+
gap: 0.5rem;
46+
}
47+
48+
.Bottom {
49+
display: flex;
50+
align-items: center;
51+
gap: 0.875rem;
52+
z-index: 1;
53+
}

src/components/common/Navbar.module.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/common/Navbar.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { useNavigate } from "react-router-dom";
2+
3+
import Navbar from "@/components/ui/Navbar/Navbar";
4+
5+
export default function ArrowNavbar() {
6+
const navigate = useNavigate();
7+
8+
const onBackBtn = () => {
9+
navigate(-1);
10+
};
11+
12+
return (
13+
<Navbar
14+
leftButton={{
15+
icon: "/src/assets/svg/ic-left-arrow.svg",
16+
alt: "뒤로 가기",
17+
onClick: onBackBtn,
18+
}}
19+
/>
20+
);
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useNavigate } from "react-router-dom";
2+
3+
import Navbar from "@/components/ui/Navbar/Navbar";
4+
5+
export default function CloseNavbar() {
6+
const navigate = useNavigate();
7+
8+
const onClose = () => {
9+
navigate("/");
10+
};
11+
12+
return (
13+
<Navbar rightButton={{ icon: "/src/assets/svg/ic-close.svg", alt: "닫기", onClick: onClose }} />
14+
);
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Text from "../Text/Text";
2+
3+
import Navbar from "@/components/ui/Navbar/Navbar";
4+
5+
export default function SecondaryNavbar() {
6+
return (
7+
<Navbar
8+
leftButton={{
9+
className: "logo",
10+
icon: "/src/assets/img/img-logo.png",
11+
alt: "로고",
12+
onClick: () => {},
13+
}}
14+
rightButton={{
15+
content: (
16+
<Text variant="bodyXsm" color="secondary" align="center" as="span">
17+
앱 공유하기
18+
</Text>
19+
),
20+
onClick: () => {},
21+
}}
22+
></Navbar>
23+
);
24+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { HTMLAttributes } from "react";
2+
3+
export interface NavbarButtonProps {
4+
className?: string;
5+
icon?: string;
6+
alt?: string;
7+
onClick?: () => void;
8+
content?: React.ReactNode;
9+
}
10+
11+
export interface BaseNavbarProps extends HTMLAttributes<HTMLDivElement> {
12+
leftButton?: NavbarButtonProps;
13+
rightButton?: NavbarButtonProps;
14+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// NavbarButton.tsx (같은 파일 or 분리)
2+
import React from "react";
3+
4+
import classNames from "classnames";
5+
6+
import type { NavbarButtonProps } from "@/components/ui/Navbar/BaseNavartypes";
7+
import styles from "@/components/ui/Navbar/Navbar.module.scss";
8+
9+
interface BaseNavbarProps {
10+
buttonProps?: NavbarButtonProps;
11+
defaultAlt?: string;
12+
}
13+
14+
const NavbarButton: React.FC<BaseNavbarProps> = ({ buttonProps, defaultAlt }) => {
15+
if (!buttonProps) return null;
16+
const { className, content, icon, alt, onClick } = buttonProps;
17+
18+
const computedClassName = className === "logo" ? classNames(styles.Logo) : classNames(className);
19+
20+
return (
21+
<button onClick={onClick}>
22+
{content ? (
23+
<button onClick={onClick}>{content}</button>
24+
) : (
25+
<img
26+
className={computedClassName}
27+
onClick={onClick}
28+
src={icon}
29+
alt={alt || defaultAlt || "button"}
30+
/>
31+
)}
32+
</button>
33+
);
34+
};
35+
36+
export default NavbarButton;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@charset "UTF-8";
2+
.NavbarStory {
3+
display: flex;
4+
flex-direction: column;
5+
gap: 1rem;
6+
}
7+
.NavbarStory .Wrapper {
8+
display: flex;
9+
gap: 1rem;
10+
justify-content: center;
11+
align-items: center;
12+
}
13+
14+
.Navbar {
15+
display: flex;
16+
align-items: center;
17+
justify-content: space-between;
18+
width: 100%;
19+
height: 2.75rem;
20+
padding: 0.75rem 1.25rem;
21+
background-color: #fff; /* 배경색 (흰색) */
22+
}
23+
24+
.Left,
25+
.Right {
26+
display: flex;
27+
align-items: center;
28+
flex: 0 0 auto;
29+
}
30+
31+
button {
32+
background: none;
33+
border: none;
34+
cursor: pointer;
35+
}
36+
button .Logo {
37+
height: 1.75rem;
38+
vertical-align: bottom;
39+
cursor: auto;
40+
}
41+
button img {
42+
-o-object-fit: contain;
43+
object-fit: contain;
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.NavbarStory {
2+
display: flex;
3+
flex-direction: column;
4+
gap: 1rem;
5+
6+
.Wrapper {
7+
display: flex;
8+
gap: 1rem;
9+
justify-content: center;
10+
align-items: center;
11+
}
12+
}
13+
14+
.Navbar {
15+
display: flex;
16+
align-items: center;
17+
justify-content: space-between;
18+
width: 100%;
19+
height: 2.75rem;
20+
padding: 0.75rem 1.25rem;
21+
background-color: #fff; /* 배경색 (흰색) */
22+
}
23+
24+
.Left,
25+
.Right {
26+
display: flex;
27+
align-items: center;
28+
flex: 0 0 auto;
29+
}
30+
31+
button {
32+
padding: 0;
33+
margin: 0;
34+
background: none;
35+
border: none;
36+
cursor: pointer;
37+
height: 100%;
38+
.Logo {
39+
height: 1.75rem;
40+
vertical-align: bottom;
41+
cursor: auto;
42+
}
43+
44+
img {
45+
object-fit: contain;
46+
}
47+
}

0 commit comments

Comments
 (0)