fix: hide navbar before user authenticates

This commit is contained in:
Taranto 2020-11-05 17:35:58 +00:00 committed by Josh Harvey
parent 7bfde033c7
commit c30998a1eb

View file

@ -7,7 +7,7 @@ import {
} from '@material-ui/core/styles' } from '@material-ui/core/styles'
import { create } from 'jss' import { create } from 'jss'
import extendJss from 'jss-plugin-extend' import extendJss from 'jss-plugin-extend'
import React, { createContext, useState } from 'react' import React, { createContext, useContext, useState } from 'react'
import { useLocation, BrowserRouter as Router } from 'react-router-dom' import { useLocation, BrowserRouter as Router } from 'react-router-dom'
import ApolloProvider from 'src/utils/apollo' import ApolloProvider from 'src/utils/apollo'
@ -54,12 +54,13 @@ const AppContext = createContext()
const Main = () => { const Main = () => {
const classes = useStyles() const classes = useStyles()
const location = useLocation() const location = useLocation()
const { wizardTested } = useContext(AppContext)
const is404 = location.pathname === '/404' const is404 = location.pathname === '/404'
return ( return (
<div className={classes.root}> <div className={classes.root}>
{!is404 && <Header tree={tree} />} {!is404 && wizardTested && <Header tree={tree} />}
<main className={classes.wrapper}> <main className={classes.wrapper}>
<Routes /> <Routes />
</main> </main>