Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

신규디자인-반영 #6

Merged
merged 4 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = {
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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>
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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>
);
};
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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: {
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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 = {};
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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.