-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor: 재정의된 컬러 반영 * New : 아이콘 에셋 추가 * New : Navbar 퍼블리싱 * New : Navbar 스토리북 추가
- Loading branch information
1 parent
ee87fb6
commit 9470e08
Showing
11 changed files
with
185 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { | ||
AppBar, | ||
ButtonBase, | ||
ButtonBaseProps, | ||
Toolbar, | ||
Typography, | ||
} from "@mui/material"; | ||
|
||
import HomeIcon from "~/assets/icons/HomeIcon.svg"; | ||
import SearchIcon from "~/assets/icons/SearchIcon.svg"; | ||
import PostIcon from "~/assets/icons/PostIcon.svg"; | ||
import BeverageIcon from "~/assets/icons/BeverageIcon.svg"; | ||
import MyIcon from "~/assets/icons/MyIcon.svg"; | ||
|
||
const NavbarData = [ | ||
{ | ||
iconComponent: <img src={HomeIcon.src} />, | ||
label: "홈", | ||
href: "/", | ||
}, | ||
{ | ||
iconComponent: <img src={SearchIcon.src} />, | ||
label: "검색", | ||
}, | ||
{ | ||
iconComponent: <img src={PostIcon.src} />, | ||
label: "올리기", | ||
}, | ||
{ | ||
iconComponent: <img src={BeverageIcon.src} />, | ||
label: "술과사전", | ||
}, | ||
{ | ||
iconComponent: <img src={MyIcon.src} />, | ||
label: "내 정보", | ||
}, | ||
]; | ||
|
||
const NavigationBar = () => { | ||
return ( | ||
<AppBar position="fixed" sx={{ top: "auto", bottom: 0 }}> | ||
<Toolbar sx={{ mx: "auto", gap: 4 }}> | ||
{NavbarData.map((buttonData) => { | ||
return ( | ||
<NavbarIconButton | ||
iconComponent={buttonData.iconComponent} | ||
key={buttonData.label} | ||
href={buttonData.href} | ||
> | ||
{buttonData.label} | ||
</NavbarIconButton> | ||
); | ||
})} | ||
</Toolbar> | ||
</AppBar> | ||
); | ||
}; | ||
|
||
export default NavigationBar; | ||
|
||
interface NavbarIconButtonInterface extends Omit<ButtonBaseProps, "children"> { | ||
children: string; | ||
iconComponent: React.ReactNode; | ||
href?: string; | ||
} | ||
export const NavbarIconButton = ({ | ||
children, | ||
iconComponent, | ||
...others | ||
}: NavbarIconButtonInterface) => { | ||
return ( | ||
<ButtonBase sx={{ flexDirection: "column", width: 56 }} {...others}> | ||
{iconComponent} | ||
<Typography variant="label" component="span"> | ||
{children} | ||
</Typography> | ||
</ButtonBase> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
client/src/stories/Components/Navigation/Navbar.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import NavigationBar from "@/components/NavigationBar"; | ||
|
||
import { Meta, StoryObj } from "@storybook/react"; | ||
const meta = { | ||
title: "Components/Navigation/NavigationBar", | ||
component: NavigationBar, | ||
tags: ["autodocs"], | ||
decorators: [ | ||
(Story) => { | ||
return ( | ||
<div | ||
style={{ minHeight: "150px" }} | ||
onClick={(e) => e.stopPropagation()} | ||
> | ||
<Story /> | ||
</div> | ||
); | ||
}, | ||
], | ||
} satisfies Meta<typeof NavigationBar>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Navbar: Story = {}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.