import React, { useState, useEffect } from 'react'; import Menu from '@material-ui/core/Menu'; import MenuItem from '@material-ui/core/MenuItem'; import { makeStyles } from '@material-ui/core/styles'; import Fade from '@material-ui/core/Fade'; import Grid from '@material-ui/core/Grid'; import { Typography, Avatar } from '@material-ui/core'; import Images from '../assets/Images'; import { Link, useRouteMatch } from 'react-router-dom'; import Constant from '../library/Constant'; const useStyles = makeStyles({ avatar: { margin: 10, }, orangeAvatar: { margin: 10, color: '#fff', backgroundColor: 'black', }, }) function FadeMenu() { const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); const handleClick = event => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; const handleLogout = () => { localStorage.removeItem(Constant.TOKEN) window.location.reload(); setAnchorEl(null); } const classes = useStyles(); let { path, url } = useRouteMatch(); return (
React Logo
T
Tommy tom_my@gmail.com
Settings
Logout
); } const footerStyle = { backgroundColor: "#0d2846", fontSize: "20px", color: "white", // borderTop: "1px solid #E7E7E7", textAlign: "center", padding: "20px", left: 0, bottom: 0, right: 0, height: "80px", width: "100%" }; const phantomStyle = { display: "block", }; function Footer({ children }) { return (
{/*
*/}
{children}
); } function getWindowDimensions() { const { innerWidth: width, innerHeight: height } = window; return { width, height }; } function UseWindowDimensions() { const [windowDimensions, setWindowDimensions] = useState( getWindowDimensions() ); useEffect(() => { function handleResize() { setWindowDimensions(getWindowDimensions()); } window.addEventListener("resize", handleResize); return () => window.removeEventListener("resize", handleResize); }, []); return windowDimensions; } export { FadeMenu, Footer, UseWindowDimensions };