Commit 3df803a8 authored by Ha YeaJin's avatar Ha YeaJin
Browse files

menu RBS 끝

parent 13004059
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Link, Redirect } from 'react-router-dom'; import { Link, Redirect } from 'react-router-dom';
import styled from 'styled-components'; import styled from 'styled-components';
import { Navbar, Nav, NavDropdown } from 'react-bootstrap'; import { Navbar, Nav, NavDropdown, NavLink } from 'react-bootstrap';
const MENU = styled(Navbar)` const MENU = styled(Navbar)`
background-color: #7B031D; background-color: #7B031D;
a {
color : white;
}
` `
function Menu() { function Menu() {
...@@ -25,76 +28,37 @@ function Menu() { ...@@ -25,76 +28,37 @@ function Menu() {
<Navbar.Toggle aria-controls="basic-navbar-nav" /> <Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav"> <Navbar.Collapse id="basic-navbar-nav">
<Nav className="mr-auto"> <Nav className="mr-auto">
<Nav.Link><Link to="/notice">공지사항</Link></Nav.Link> <NavLink as={Link} to="/notice">공지사항</NavLink>
<Nav.Link><Link to="/home">대관 현황</Link></Nav.Link> <NavLink as={Link} to="/home">대관 현황</NavLink>
<Nav.Link><Link to={{
<NavLink as={Link} to={{
pathname: `/apply/${localStorage.getItem('_id')}`, pathname: `/apply/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') }, state: { id: localStorage.getItem('_id') },
}} className="nav-link">대관 신청</Link></Nav.Link> }} className="nav-link">대관 신청</NavLink>
<Nav.Link><Link to={{
<NavLink as={Link} to={{
pathname: `/check/${localStorage.getItem('_id')}`, pathname: `/check/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') }, state: { id: localStorage.getItem('_id') },
}} className="nav-link"> }} className="nav-link">
대관 확인/취소</Link></Nav.Link> 대관 확인/취소</NavLink>
<Nav.Link><Link to={{
<NavLink as={Link} to={{
pathname: `/acheck/${localStorage.getItem('_id')}`, pathname: `/acheck/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') }, state: { id: localStorage.getItem('_id') },
}} className="nav-link"> }} className="nav-link">
대관 확인/취소(관리자)</Link></Nav.Link> 대관 확인/취소(관리자)</NavLink>
<Nav.Link> </Nav>
<div className="text-white text-right font-weight-light"><small>{name}</small></div> <Nav >
<NavLink>
<div className="text-white text-right font-weight-light"><small> <small className="d-flex flex-row justify-content-end">
<Link to={{ <div className="text-white text-right font-weight-light pr-2">{name}</div>
<NavLink className="p-0" as={Link} to={{
pathname: `/change/${localStorage.getItem('_id')}`, pathname: `/change/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') }, state: { id: localStorage.getItem('_id') },
}}>비밀번호 변경</Link> / <span className="logoutBtn" onClick={logout} >로그아웃</span></small></div> }}> 비밀번호 변경 </NavLink> / <NavLink className="p-0" onClick={logout} > 로그아웃</NavLink></small>
</Nav.Link> </NavLink>
</Nav> </Nav>
</Navbar.Collapse> </Navbar.Collapse>
{/* <button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar" aria-controls="collapsibleNavbar">
<span className="navbar-toggler-icon"></span>
</button> */}
{/* <div className="collapse navbar-collapse justify-content-between" id="collapsibleNavbar">
<ul className="navbar-nav">
<li className="nav-item">
<Link to="/notice" className="nav-link">공지사항</Link>
</li>
<li className="nav-item">
<Link to="/home" className="nav-link">대관 현황</Link>
</li>
<li className="nav-item">
<Link to={{
pathname: `/apply/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') },
}} className="nav-link">대관 신청</Link>
</li>
<li className="nav-item">
<Link to={{
pathname: `/check/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') },
}} className="nav-link">
대관 확인/취소</Link>
</li>
<li className="nav-item">
<Link to={{
pathname: `/acheck/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') },
}} className="nav-link">
대관 확인/취소(관리자)</Link>
</li>
</ul>
<div className="h-100 mr-3">
<div className="text-white text-right font-weight-light"><small>{name}님 안녕하세요</small></div>
<div className="text-white text-right font-weight-light"><small>
<Link to={{
pathname: `/change/${localStorage.getItem('_id')}`,
state: { id: localStorage.getItem('_id') },
}}>비밀번호 변경</Link> / <span className="logoutBtn" onClick={logout} >로그아웃</span></small></div>
</div>
</div> */}
</MENU > </MENU >
) )
} }
......
...@@ -28,7 +28,7 @@ function Notice() { ...@@ -28,7 +28,7 @@ function Notice() {
axios.get(`/notices`) axios.get(`/notices`)
.then(res => { .then(res => {
if (res.status !== 201) { if (res.status !== 201) {
alert(res.data.error); // alert(res.data.error);
} }
setNotices(res.data); setNotices(res.data);
}) })
......
...@@ -10,6 +10,7 @@ router.get('/', function (req, res, next) { ...@@ -10,6 +10,7 @@ router.get('/', function (req, res, next) {
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
next(err); next(err);
}); });
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment