WordClockESP/interface/src/AppRouting.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

import React, { Component } from 'react';
import { Redirect, Switch } from 'react-router';
2019-05-14 21:47:04 +00:00
import * as Authentication from './authentication/Authentication';
import AuthenticationWrapper from './authentication/AuthenticationWrapper';
import AuthenticatedRoute from './authentication/AuthenticatedRoute';
import UnauthenticatedRoute from './authentication/UnauthenticatedRoute';
2019-05-14 22:18:24 +00:00
import SignInPage from './containers/SignInPage';
2019-05-26 19:49:15 +00:00
import WiFiConnection from './sections/WiFiConnection';
2019-05-26 20:27:35 +00:00
import AccessPoint from './sections/AccessPoint';
import NetworkTime from './sections/NetworkTime';
import Security from './sections/Security';
import System from './sections/System';
class AppRouting extends Component {
2019-05-14 21:47:04 +00:00
componentWillMount() {
Authentication.clearLoginRedirect();
}
render() {
return (
<AuthenticationWrapper>
<Switch>
<UnauthenticatedRoute exact path="/" component={SignInPage} />
2019-05-26 19:49:15 +00:00
<AuthenticatedRoute exact path="/wifi/*" component={WiFiConnection} />
2019-05-26 20:27:35 +00:00
<AuthenticatedRoute exact path="/ap/*" component={AccessPoint} />
<AuthenticatedRoute exact path="/ntp/*" component={NetworkTime} />
<AuthenticatedRoute exact path="/security/*" component={Security} />
2019-05-26 23:04:29 +00:00
<AuthenticatedRoute exact path="/system/*" component={System} />
2019-05-14 21:47:04 +00:00
<Redirect to="/" />
</Switch>
</AuthenticationWrapper>
)
}
}
export default AppRouting;