Dashboard.jsx 797 Bytes
Newer Older
Jure's avatar
Jure committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import React from 'react'
import { Route, Switch, Redirect } from 'react-router-dom'
import AuthenticatedComponent from 'pubsweet-client/src/components/AuthenticatedComponent'

import ConnectedNavigation from './Navigation/ConnectedNavigation'
import HelloWorld from './HelloWorld'
import KitchenSink from './KitchenSink'

const Dashboard = () => (
  <>
    {/* Everything in the dashboard is for authenticated users only */}
    <AuthenticatedComponent>
      <ConnectedNavigation />
      <Switch>
        <Redirect exact path="/dashboard" to="/dashboard/hello-world" />
        <Route component={HelloWorld} path="/dashboard/hello-world" />
        <Route component={KitchenSink} path="/dashboard/kitchen-sink" />
      </Switch>
    </AuthenticatedComponent>
  </>
)

export default Dashboard