Skip to content

Commit

Permalink
신규디자인-반영 (#6)
Browse files Browse the repository at this point in the history
* Refactor: 재정의된 컬러 반영

* New : 아이콘 에셋 추가

* New : Navbar 퍼블리싱

* New : Navbar 스토리북 추가
  • Loading branch information
jobkaeHenry authored Nov 5, 2023
1 parent ee87fb6 commit 9470e08
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 10 deletions.
6 changes: 3 additions & 3 deletions client/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const config: StorybookConfig = {
},
staticDirs: [
{
from: '../src/assets/font',
to: '/src/assets/font'
}
from: "../src/assets",
to: "/src/assets",
},
],
webpackFinal: async (config, { configType }) => {
config.resolve!.alias = {
Expand Down
4 changes: 3 additions & 1 deletion client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import ThemeRegistry from "@/components/theme/ThemeRegistry";
import { nameOfApp, oneLineMessage } from "@/const/brand";
import OverrideCSS from "@/const/overrideCSS";
import { GlobalStyles } from "@mui/material";
import Pretendard from "@/assets/font/Pretendard";
import Pretendard from "~/assets/font/Pretendard";
import NavigationBar from "~/components/NavigationBar";

export const metadata: Metadata = {
title: `${nameOfApp} | ${oneLineMessage}`,
Expand All @@ -25,6 +26,7 @@ export default function RootLayout({
<ThemeRegistry options={{ key: "mui" }}>
<GlobalStyles styles={OverrideCSS} />
{children}
<NavigationBar />
</ThemeRegistry>
</body>
</html>
Expand Down
10 changes: 10 additions & 0 deletions client/src/assets/icons/BeverageIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions client/src/assets/icons/HomeIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions client/src/assets/icons/MyIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions client/src/assets/icons/PostIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions client/src/assets/icons/SearchIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions client/src/components/NavigationBar.tsx
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>
);
};
21 changes: 15 additions & 6 deletions client/src/const/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,31 @@ const theme = createTheme({
palette: {
mode: "light",
primary: {
main: "#82BCDB",
main: "#7B1FA2",
contrastText: "#fff",
},
secondary: {
main: "#00dde6",
main: "#C2185B",
},
text: {
primary: "#3D4A59",
secondary: "#558C99",
disabled: "#6D7A89",
primary: "#1C1C1C",
secondary: "#8A8A8A",
disabled: "#B8B8B8",
},
divider: "#CDD4D4",
background: {
default: "#E9F3F3",
default: "#F5F5F5",
paper: "#fefefe",
},
info: {
main: "#00C853",
},
error: {
main: "#D50000",
},
warning: {
main: "#FFD600",
},
},
components: {
MuiButton: {
Expand Down
25 changes: 25 additions & 0 deletions client/src/stories/Components/Navigation/Navbar.stories.tsx
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 = {};
10 changes: 10 additions & 0 deletions client/static/media/HomeIcon.d2ed79b6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9470e08

Please sign in to comment.