Skip to content

Commit

Permalink
๐Ÿ’„ [Client] Nav.js : menu bar ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
NAPP4287 committed Aug 29, 2021
1 parent f578471 commit 1600bc7
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions client/src/comp/Nav.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
import React, { useState } from "react";
import styled from "styled-components";
import {Link} from "react-router-dom"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faBars } from '@fortawesome/free-solid-svg-icons'
import { Link } from "react-router-dom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBars } from "@fortawesome/free-solid-svg-icons";
import profile from "../none_profile.jpeg";

// 768px ์ด์ƒ์—์„œ๋Š” nav๊ฐ€ ๋ณด์ด๊ณ , ์•„์ด์ฝ˜ ์•ˆ๋ณด์ž„
// 768px ์ดํ•˜๋Š” nav ์•ˆ๋ณด์ด๊ณ  ์•„์ด์ฝ˜ ๋ณด์ž„

function Nav({ isLogin }) {
const [isShow, setIsShow] = useState("none");
const onClick = () => {
isShow === "none" ? setIsShow("flex") : setIsShow("none");
};

const NavBtn = styled.button`
position:absolute;
top:0px;
background-color:transparent;
width:max(3vw,60px);
height:max(3vw,60px);
font-size:max(3vw,30px);
transition:all 0.3s;
cursor:pointer;
z-index:100;
:hover{
color:#fff;
position: absolute;
top: 0px;
background-color: transparent;
width: max(3vw, 60px);
height: max(3vw, 60px);
font-size: max(3vw, 30px);
transition: all 0.3s;
cursor: pointer;
z-index: 100;
:hover {
color: #fff;
}
@media screen and (min-width: 768px){
display:none;
@media screen and (min-width: 768px) {
display: block;
}
`
`;

const NavWrap = styled.nav`
@media screen and (max-width: 767px){
flex:none;
position:absolute;
width:100%;
height:100vh;
display:flex;
justify-content:center;
align-items:center;
}
@media screen and (max-width: 767px) {
flex: none;
position: absolute;
width: 100%;
height: 100vh;
display: ${isShow};
justify-content: center;
align-items: center;
}
background-color: #38372e;
flex: 1 1 auto;
display:flex;
min-height:100vh;
justify-content:center;
align-items:center;
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
/* z-index:100; */
`;

Expand Down Expand Up @@ -100,8 +105,8 @@ function Nav({ isLogin }) {
<>
{isLogin ? (
<>
<NavBtn>
<FontAwesomeIcon icon={faBars}/>
<NavBtn onClick={onClick}>
<FontAwesomeIcon icon={faBars} />
</NavBtn>
<NavWrap>
<div>
Expand All @@ -111,9 +116,7 @@ function Nav({ isLogin }) {
</ProfileWrap>
<Button2>LOGOUT</Button2>
<Button2>
<Link to="/mypage">
MYPAGE
</Link>
<Link to="/mypage">MYPAGE</Link>
</Button2>
</div>
</NavWrap>
Expand Down

0 comments on commit 1600bc7

Please sign in to comment.