2020-11-08 21:18:15 +00:00
|
|
|
import React from 'react';
|
2022-05-28 17:32:35 +00:00
|
|
|
import { NavLink, Route, 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';
|
2022-05-14 21:31:53 +00:00
|
|
|
import AccountSSHContainer from '@/components/dashboard/ssh/AccountSSHContainer';
|
2022-05-28 17:32:35 +00:00
|
|
|
import { useLocation } from 'react-router';
|
2022-06-05 22:35:53 +00:00
|
|
|
import ActivityLogContainer from '@/components/dashboard/activity/ActivityLogContainer';
|
2019-06-26 04:28:56 +00:00
|
|
|
|
2022-05-28 17:32:35 +00:00
|
|
|
export default () => {
|
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<NavigationBar/>
|
|
|
|
{location.pathname.startsWith('/account') &&
|
|
|
|
<SubNavigation>
|
|
|
|
<div>
|
|
|
|
<NavLink to={'/account'} exact>Settings</NavLink>
|
|
|
|
<NavLink to={'/account/api'}>API Credentials</NavLink>
|
|
|
|
<NavLink to={'/account/ssh'}>SSH Keys</NavLink>
|
2022-06-05 22:35:53 +00:00
|
|
|
<NavLink to={'/account/activity'}>Activity</NavLink>
|
2022-05-28 17:32:35 +00:00
|
|
|
</div>
|
|
|
|
</SubNavigation>
|
|
|
|
}
|
|
|
|
<TransitionRouter>
|
|
|
|
<Switch location={location}>
|
|
|
|
<Route path={'/'} exact>
|
|
|
|
<DashboardContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/account'} exact>
|
|
|
|
<AccountOverviewContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/account/api'} exact>
|
|
|
|
<AccountApiContainer/>
|
|
|
|
</Route>
|
|
|
|
<Route path={'/account/ssh'} exact>
|
|
|
|
<AccountSSHContainer/>
|
|
|
|
</Route>
|
2022-06-05 22:35:53 +00:00
|
|
|
<Route path={'/account/activity'} exact>
|
|
|
|
<ActivityLogContainer />
|
|
|
|
</Route>
|
2022-05-28 17:32:35 +00:00
|
|
|
<Route path={'*'}>
|
|
|
|
<NotFound/>
|
|
|
|
</Route>
|
|
|
|
</Switch>
|
|
|
|
</TransitionRouter>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|