Skip to content

Commit

Permalink
refactor: navbar 수정, 미사용 파일 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
sikkzz committed Feb 4, 2025
1 parent 97f5f6c commit b23a338
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 300 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NavbarV2 {
.Navbar {
display: flex;
align-items: center;
justify-content: space-between;
Expand Down
62 changes: 62 additions & 0 deletions src/components/common/Navbar/Navbar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { MemoryRouter } from "react-router-dom";

import Navbar from "@/components/common/Navbar/Navbar";
import Icon from "@/components/ui/Icon/Icon";
import Text from "@/components/ui/Text/Text";

import type { Meta, StoryObj } from "@storybook/react";

const meta: Meta = {
title: "Components/Navbar",
decorators: [
(Story) => (
<MemoryRouter>
<div style={{ width: 350, border: "1px solid #ccc" }}>
<Story />
</div>
</MemoryRouter>
),
],
};

export default meta;

type Story = StoryObj;

export const HomeNavbar: Story = {
name: "HomeNavbar",
render: () => (
<Navbar>
<Navbar.LeftButton>
<Icon name="logo" />
</Navbar.LeftButton>
<Navbar.RightButton>
<Text variant="bodySm" color="secondary">
앱 공유하기
</Text>
</Navbar.RightButton>
</Navbar>
),
};

export const ArrowNavbar: Story = {
name: "ArrowNavbar",
render: () => (
<Navbar>
<Navbar.LeftButton>
<Icon name="leftArrow" />
</Navbar.LeftButton>
</Navbar>
),
};

export const CloseNavbar: Story = {
name: "CloseNavbar",
render: () => (
<Navbar>
<Navbar.RightButton>
<Icon name="close" />
</Navbar.RightButton>
</Navbar>
),
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import type { ButtonHTMLAttributes, PropsWithChildren } from "react";

import classNames from "classnames";

import styles from "@/components/ui/NavbarV2/NavbarV2.module.scss";
import styles from "@/components/common/Navbar/Navbar.module.scss";

const NavbarV2 = ({ children }: PropsWithChildren) => {
return <div className={styles.NavbarV2}>{children}</div>;
const Navbar = ({ children }: PropsWithChildren) => {
return <div className={styles.Navbar}>{children}</div>;
};

NavbarV2.LeftButton = ({
Navbar.LeftButton = ({
children,
// 확장성 고려해서 className 추가 현재 디자인상에서는 사실 필요 없기는 함
className,
...props
}: ButtonHTMLAttributes<HTMLButtonElement>) => {
Expand All @@ -21,7 +20,7 @@ NavbarV2.LeftButton = ({
);
};

NavbarV2.RightButton = ({
Navbar.RightButton = ({
children,
className,
...props
Expand All @@ -33,4 +32,4 @@ NavbarV2.RightButton = ({
);
};

export default NavbarV2;
export default Navbar;
21 changes: 0 additions & 21 deletions src/components/ui/ArrowNavbar/ArrowNavbar.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/ui/CloseNavbar/CloseNavbar.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/ui/HomeNavbar/HomeNavbar.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/components/ui/Navbar/BaseNavartypes.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/components/ui/Navbar/NavButton.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions src/components/ui/Navbar/Navbar.module.css

This file was deleted.

47 changes: 0 additions & 47 deletions src/components/ui/Navbar/Navbar.module.scss

This file was deleted.

39 changes: 0 additions & 39 deletions src/components/ui/Navbar/Navbar.stories.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions src/components/ui/Navbar/Navbar.tsx

This file was deleted.

Loading

0 comments on commit b23a338

Please sign in to comment.