summaryrefslogtreecommitdiff
path: root/blocks/eda-frontend/src/pages/Dashboard.js
blob: 6ab62a86d95116b622d7bac1f62f254617e362a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Main Layout for user dashboard.
import { useEffect } from 'react'
import { Switch, Route } from 'react-router-dom'

import { CssBaseline } from '@material-ui/core'
import { makeStyles } from '@material-ui/core/styles'

import DashboardHome from '../components/Dashboard/DashboardHome'
import DashboardSidebar from '../components/Dashboard/DashboardSidebar'
import SchematicsList from '../components/Dashboard/SchematicsList'
import Layout from '../components/Shared/Layout'
import LayoutMain from '../components/Shared/LayoutMain'
import { Header } from '../components/Shared/Navbar'

const useStyles = makeStyles((_theme) => ({
  root: {
    display: 'flex',
    minHeight: '100vh'
  },
  toolbar: {
    minHeight: '40px'
  }
}))

export default function Dashboard () {
  const classes = useStyles()

  useEffect(() => {
    document.title = 'Dashboard - ' + process.env.REACT_APP_NAME
  }, [])

  return (
    <div className={classes.root}>
      <CssBaseline />

      {/* Schematic editor header and left side pane */}
      <Layout resToolbar={<Header />} sidebar={<DashboardSidebar />} />

      <LayoutMain>
        <div className={classes.toolbar} />

        {/* Subroutes under dashboard section */}
        <Switch>
          <Route exact path='/dashboard' component={DashboardHome} />
          <Route exact path='/dashboard/profile' />
          <Route
            exact
            path='/dashboard/schematics'
            component={SchematicsList}
          />
        </Switch>
      </LayoutMain>
    </div>
  )
}