Skip to content

Instantly share code, notes, and snippets.

@MilanRgm
Last active June 5, 2018 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilanRgm/18f5ecc1b2b1f83b350d24b05abf5a6c to your computer and use it in GitHub Desktop.
Save MilanRgm/18f5ecc1b2b1f83b350d24b05abf5a6c to your computer and use it in GitHub Desktop.
//app
const App = props => (
<Switch>
<UnauthenticatedRoute path="/login" name="login" component={AsyncLogin} {...props} />
<UnauthenticatedRoute path="/signup" name="signup" component={AsyncSignUp} {...props} />
<AuthenticatedRoute path="/" name="Home" component={AsyncHome} {...props} />
</Switch>
);
//Home
const Home = props => (
<Switch>
<DashboardRoute exact path="/" component={() => <div>Hello</div>} {...props} />
<DashboardRoute path="/profile" name="profile" component={Profile} {...props} />
</Switch>
);
//Profile
const Profile = props => (
<Root>
<ProfileSidebar />
<Main>
<Switch>
<Route path="general" component={General} {...props} />
<Route path="company" component={Company} {...props} />
<Route path="password" component={Password} {...props} />
</Switch>
</Main>
</Root>
);
export default withRouter(Profile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment