Created
November 17, 2017 07:56
-
-
Save tapandave08/112c1dc71171ba0167733180eaff7c99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import "./App.css"; | |
import { Route, Switch, Router } from "react-router-dom"; | |
import Header from "../src/components/header/header"; | |
import SideBar from "../src/components/sidebar/sidebar"; | |
import Login from "./components/login/login.js"; | |
import Dashboard from "./components/dashboard/dashboard"; | |
import RequireAuth from "./components/utility/require-auth"; | |
import history from "./components/utility/history"; | |
import Profile from "./components/user/profile"; | |
class App extends Component { | |
render() { | |
return ( | |
<Router history={history}> | |
<Switch> | |
<Route path="/" exact component={Login} /> | |
<Route path="/layout" exact component={Container} /> | |
{/* <Route path="/profile" exact component={RequireAuth(Profile)} /> */} | |
</Switch> | |
</Router> | |
); | |
} | |
} | |
const Container = ({ match }) => ( | |
<div> | |
<Header /> | |
<div className="main"> | |
<SideBar /> | |
<Route | |
path={`${match.path}/dashboard`} | |
component={RequireAuth(Dashboard)} | |
/> | |
</div> | |
</div> | |
); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment