2019-06-25 21:28:56 -07:00
|
|
|
import * as React from 'react';
|
2020-03-22 18:15:38 -07:00
|
|
|
import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom';
|
2019-06-25 21:28:56 -07:00
|
|
|
import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer';
|
|
|
|
import NavigationBar from '@/components/NavigationBar';
|
|
|
|
import DashboardContainer from '@/components/dashboard/DashboardContainer';
|
2020-03-22 18:15:38 -07:00
|
|
|
import AccountApiContainer from '@/components/dashboard/AccountApiContainer';
|
2020-04-17 11:17:01 -07:00
|
|
|
import NotFound from '@/components/screens/NotFound';
|
2020-07-04 09:46:26 -07:00
|
|
|
import TransitionRouter from '@/TransitionRouter';
|
2020-07-04 15:40:41 -07:00
|
|
|
import SubNavigation from '@/components/elements/SubNavigation';
|
2019-06-25 21:28:56 -07:00
|
|
|
|
2019-06-28 22:17:29 -07:00
|
|
|
export default ({ location }: RouteComponentProps) => (
|
2020-07-03 14:50:37 -07:00
|
|
|
<>
|
2019-06-25 21:28:56 -07:00
|
|
|
<NavigationBar/>
|
2020-03-22 18:15:38 -07:00
|
|
|
{location.pathname.startsWith('/account') &&
|
2020-07-03 15:37:26 -07:00
|
|
|
<SubNavigation>
|
|
|
|
<div>
|
2020-07-03 14:50:37 -07:00
|
|
|
<NavLink to={'/account'} exact>Settings</NavLink>
|
|
|
|
<NavLink to={'/account/api'}>API Credentials</NavLink>
|
2020-03-22 18:15:38 -07:00
|
|
|
</div>
|
2020-07-03 15:37:26 -07:00
|
|
|
</SubNavigation>
|
2020-03-22 18:15:38 -07:00
|
|
|
}
|
2019-06-28 22:17:29 -07:00
|
|
|
<TransitionRouter>
|
2019-12-22 21:18:29 -08:00
|
|
|
<Switch location={location}>
|
|
|
|
<Route path={'/'} component={DashboardContainer} exact/>
|
2020-03-22 18:15:38 -07:00
|
|
|
<Route path={'/account'} component={AccountOverviewContainer} exact/>
|
|
|
|
<Route path={'/account/api'} component={AccountApiContainer} exact/>
|
2020-04-17 11:17:01 -07:00
|
|
|
<Route path={'*'} component={NotFound}/>
|
2019-12-22 21:18:29 -08:00
|
|
|
</Switch>
|
2019-06-28 22:17:29 -07:00
|
|
|
</TransitionRouter>
|
2020-07-03 14:50:37 -07:00
|
|
|
</>
|
2019-06-25 21:28:56 -07:00
|
|
|
);
|