2020-11-08 21:18:15 +00:00
|
|
|
import React from 'react';
|
2020-10-13 03:59:11 +00:00
|
|
|
import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom';
|
2019-06-26 04:28:56 +00:00
|
|
|
import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer';
|
|
|
|
import NavigationBar from '@/components/NavigationBar';
|
|
|
|
import DashboardContainer from '@/components/dashboard/DashboardContainer';
|
2020-03-23 01:15:38 +00:00
|
|
|
import AccountApiContainer from '@/components/dashboard/AccountApiContainer';
|
2021-01-31 02:01:32 +00:00
|
|
|
import { NotFound } from '@/components/elements/ScreenBlock';
|
2020-07-04 16:46:26 +00:00
|
|
|
import TransitionRouter from '@/TransitionRouter';
|
2020-07-04 22:40:41 +00:00
|
|
|
import SubNavigation from '@/components/elements/SubNavigation';
|
2019-06-26 04:28:56 +00:00
|
|
|
|
2020-11-08 21:18:15 +00:00
|
|
|
export default ({ location }: RouteComponentProps) => (
|
|
|
|
<>
|
|
|
|
<NavigationBar/>
|
|
|
|
{location.pathname.startsWith('/account') &&
|
|
|
|
<SubNavigation>
|
|
|
|
<div>
|
|
|
|
<NavLink to={'/account'} exact>Settings</NavLink>
|
|
|
|
<NavLink to={'/account/api'}>API Credentials</NavLink>
|
|
|
|
</div>
|
|
|
|
</SubNavigation>
|
|
|
|
}
|
|
|
|
<TransitionRouter>
|
|
|
|
<Switch location={location}>
|
2021-03-21 19:07:24 +00:00
|
|
|
<Route path={'/'} exact>
|
|
|
|
<DashboardContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/account'} exact>
|
|
|
|
<AccountOverviewContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/account/api'} exact>
|
|
|
|
<AccountApiContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'*'}>
|
|
|
|
<NotFound/>
|
|
|
|
</Route>
|
2020-11-08 21:18:15 +00:00
|
|
|
</Switch>
|
|
|
|
</TransitionRouter>
|
|
|
|
</>
|
|
|
|
);
|