import React, {useState} from 'react'; import {BrowserView, MobileView} from "react-device-detect"; import {Link} from 'react-router-dom'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import Button from '@material-ui/core/Button'; import HomeIcon from '@material-ui/icons/Home'; import PolymerIcon from '@material-ui/icons/Polymer'; import AppsIcon from '@material-ui/icons/Apps'; import DescriptionIcon from '@material-ui/icons/Description'; import Grid from '@material-ui/core/Grid'; const hoverColor = "#f85a3e" const hoverOutColor = "#e8eaf6" const Header = props => { const { globalUrl, isLoggedIn, removeCookie, homePage, isLoaded } = props; const [HomeHoverColor, setHomeHoverColor] = useState(hoverOutColor); const [SoarHoverColor, setSoarHoverColor] = useState(hoverOutColor); const [LoginHoverColor, setLoginHoverColor] = useState(hoverOutColor); const [DocsHoverColor, setDocsHoverColor] = useState(hoverOutColor); const [HelpHoverColor, setHelpHoverColor] = useState(hoverOutColor); const hrefStyle = { color: hoverOutColor, textDecoration: "none", } // DEBUG HERE const handleClickLogout = () => { console.log("SHOULD LOG OUT") console.log(isLoggedIn) // Don't really care about the logout fetch(globalUrl+"/api/v1/logout", { credentials: "include", method: 'POST', headers: { 'Content-Type': 'application/json', }, }) .then(() => { // Log out anyway console.log("Hey") removeCookie("session_token", {path: "/"}) window.location.pathname = "/" }) .catch(error => { console.log(error) }); } // Rofl this is weird const handleDocsHover = () => { setDocsHoverColor(hoverColor) } const handleDocsHoverOut = () => { setDocsHoverColor(hoverOutColor) } const handleHomeHover = () => { setHomeHoverColor(hoverColor) } const handleHelpHover = () => { setHelpHoverColor(hoverColor) } const handleHelpHoverOut = () => { setHelpHoverColor(hoverOutColor) } const handleSoarHover = () => { setSoarHoverColor(hoverColor) } const handleSoarHoverOut = () => { setSoarHoverColor(hoverOutColor) } const handleHomeHoverOut = () => { setHomeHoverColor(hoverOutColor) } const handleLoginHover = () => { setLoginHoverColor(hoverColor) } const handleLoginHoverOut = () => { setLoginHoverColor(hoverOutColor) } // Should be based on some path const logoCheck = !homePage ? null : null // Handle top bar or something const loginTextBrowser = !isLoggedIn ?