MenuIcons.js 2.42 KB
import React from "react";
import styled from "styled-components";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
  faHome,
  faComment,
  faCog,
  faSignOutAlt,
  faQuestionCircle,
  faTags,
} from "@fortawesome/free-solid-svg-icons";
import { BrowserRouter as Router, Link } from "react-router-dom";

const HomeIconBox = styled.div`
  width: 100%;
  height: 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  opacity: 0.8;
  color: white;
  cursor: pointer;
  transition: 0.5s;
  &:hover {
    color: #667aff;
    background-color: white;
  }
`;

const FuncIconBox = styled.div`
  width: 100%;
  height: 60%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  opacity: 0.8;
  color: white;
`;

// 개별 아이콘을 상자로 묶기 위한 변수
const IconBox = styled.div`
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: 0.5s;
  &:hover {
    color: #667aff;
    background-color: white;
  }
  svg {
    font-size: 20px;
    margin-right: 5px;
  }
  cursor: pointer;
`;

const ExitIconBox = styled.div`
  width: 100%;
  height: 15%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  color: white;
  cursor: pointer;
  transition: 0.5s;
  &:hover {
    color: #667aff;
    background-color: white;
  }
  svg {
    font-size: 20px;
    margin-right: 5px;
  }
`;

const IconName = styled.span`
  font-size: 10px;
`;

export default () => {
  return (
    <>
      <Router>
        <HomeIconBox>
          <FontAwesomeIcon icon={faHome} />
        </HomeIconBox>
        <FuncIconBox>
          <IconBox>
            <FontAwesomeIcon icon={faComment} />
            <IconName /> One To One Chat
          </IconBox>
          <IconBox>
            <FontAwesomeIcon icon={faQuestionCircle} />
            <IconName /> Random Chat
          </IconBox>
          <IconBox>
            <FontAwesomeIcon icon={faTags} />
            <IconName /> Category Chat
          </IconBox>
          <IconBox>
            <FontAwesomeIcon icon={faCog} />
            <IconName /> Profile Setting
          </IconBox>
        </FuncIconBox>
        <ExitIconBox>
          <FontAwesomeIcon icon={faSignOutAlt} />
          <IconName /> Log Out
        </ExitIconBox>
      </Router>
    </>
  );
};