From 9921d9c3654d27f89420467a19030078de30a603 Mon Sep 17 00:00:00 2001 From: doheez Date: Fri, 5 Aug 2022 21:51:01 +0900 Subject: [PATCH] feat: Create menu bar component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 모든 페이지의 최상단에 위치하는 메뉴바를 생성한다. 메뉴바는 900px을 기준으로 반응형으로 동작하며, 프로필 아이콘 버튼 클릭 시 환경 설정 관련 메뉴가 등장한다. task: #4 --- client/components/organisms/MenuBar.tsx | 147 ++++++++++++++++++++++++ client/pages/index.tsx | 8 +- 2 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 client/components/organisms/MenuBar.tsx diff --git a/client/components/organisms/MenuBar.tsx b/client/components/organisms/MenuBar.tsx new file mode 100644 index 0000000..f75bdae --- /dev/null +++ b/client/components/organisms/MenuBar.tsx @@ -0,0 +1,147 @@ +import * as React from 'react'; +import {AppBar, Box, Toolbar, IconButton, Typography, Menu, Container, Button, Tooltip, MenuItem} from '@mui/material'; +import MenuIcon from '@mui/icons-material/Menu'; +import PetsIcon from '@mui/icons-material/Pets'; +import AccountCircle from '@mui/icons-material/AccountCircle'; + +const pages = ['통합저장소', '태그', '병합하기']; +const settings = ['Profile', 'Account', 'Dashboard', 'Logout']; + +const MenuBar = () => { + const [anchorElNav, setAnchorElNav] = React.useState(null); + const [anchorElUser, setAnchorElUser] = React.useState(null); + + const handleOpenNavMenu = (event: React.MouseEvent) => { + setAnchorElNav(event.currentTarget); + }; + const handleOpenUserMenu = (event: React.MouseEvent) => { + setAnchorElUser(event.currentTarget); + }; + + const handleCloseNavMenu = () => { + setAnchorElNav(null); + }; + + const handleCloseUserMenu = () => { + setAnchorElUser(null); + }; + + return ( + + + + + + MergeDoc + + + + + + + + {pages.map((page) => ( + + {page} + + ))} + + + + + MergeDoc + + + {pages.map((page) => ( + + ))} + + + + + + + + + + {settings.map((setting) => ( + + {setting} + + ))} + + + + + + ); +}; +export default MenuBar; \ No newline at end of file diff --git a/client/pages/index.tsx b/client/pages/index.tsx index 54c5aff..b6b4cf9 100644 --- a/client/pages/index.tsx +++ b/client/pages/index.tsx @@ -2,22 +2,20 @@ import type { NextPage } from "next"; import Head from "next/head"; import Image from "next/image"; import styles from "../styles/Home.module.css"; -import { Button } from "@mui/material"; +import MenuBar from "../components/organisms/MenuBar"; const Home: NextPage = () => { return ( -
+
Create Next App +

Last test for Jenkins + next.js !

- - -

Get started by editing{" "} pages/index.tsx