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';
|
2021-07-17 19:20:03 +00:00
|
|
|
import TransitionRouter from '@/TransitionRouter';
|
2019-06-26 04:28:56 +00:00
|
|
|
import NavigationBar from '@/components/NavigationBar';
|
|
|
|
import DashboardContainer from '@/components/dashboard/DashboardContainer';
|
2021-07-17 19:20:03 +00:00
|
|
|
import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer';
|
2020-03-23 01:15:38 +00:00
|
|
|
import AccountApiContainer from '@/components/dashboard/AccountApiContainer';
|
2021-07-17 19:20:03 +00:00
|
|
|
import SecurityKeyContainer from '@/components/dashboard/SecurityKeyContainer';
|
2021-07-17 21:45:46 +00:00
|
|
|
import SSHKeyContainer from '@/components/dashboard/SSHKeyContainer';
|
2021-01-31 02:01:32 +00:00
|
|
|
import { NotFound } from '@/components/elements/ScreenBlock';
|
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>
|
2021-07-17 19:20:03 +00:00
|
|
|
<NavLink to={'/account/keys/security'}>Security Keys</NavLink>
|
2021-07-17 21:45:46 +00:00
|
|
|
<NavLink to={'/account/keys/ssh'}>SSH Keys</NavLink>
|
2020-11-08 21:18:15 +00:00
|
|
|
</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>
|
2021-07-17 19:20:03 +00:00
|
|
|
<Route path={'/account/keys/security'} exact>
|
|
|
|
<SecurityKeyContainer/>
|
|
|
|
</Route>
|
2021-07-17 21:45:46 +00:00
|
|
|
<Route path={'/account/keys/ssh'} exact>
|
|
|
|
<SSHKeyContainer/>
|
|
|
|
</Route>
|
2021-03-21 19:07:24 +00:00
|
|
|
<Route path={'*'}>
|
|
|
|
<NotFound/>
|
|
|
|
</Route>
|
2020-11-08 21:18:15 +00:00
|
|
|
</Switch>
|
|
|
|
</TransitionRouter>
|
|
|
|
</>
|
|
|
|
);
|