2020-07-27 01:05:54 +00:00
|
|
|
import React, { useEffect } from 'react';
|
|
|
|
import ReactGA from 'react-ga';
|
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';
|
2020-04-17 18:17:01 +00:00
|
|
|
import NotFound from '@/components/screens/NotFound';
|
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-07-27 01:05:54 +00:00
|
|
|
export default ({ location }: RouteComponentProps) => {
|
|
|
|
useEffect(() => {
|
|
|
|
ReactGA.pageview(location.pathname);
|
|
|
|
}, [ location.pathname ]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<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}>
|
|
|
|
<Route path={'/'} component={DashboardContainer} exact />
|
|
|
|
<Route path={'/account'} component={AccountOverviewContainer} exact/>
|
|
|
|
<Route path={'/account/api'} component={AccountApiContainer} exact/>
|
|
|
|
<Route path={'*'} component={NotFound} />
|
|
|
|
</Switch>
|
|
|
|
</TransitionRouter>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|