Mohmn 5e828bf174
fix(FE): removed time filter from settings page #374 (#385)
* fix(FE): removed time filter from settings page #374

* declared an array consisting of routes,in which we won't have to render time filter component

Co-authored-by: Mohmin2 <mohmin@expansionjs.com>
2021-12-02 19:04:13 +05:30

36 lines
736 B
TypeScript

import { Col } from 'antd';
import ROUTES from 'constants/routes';
import history from 'lib/history';
import React from 'react';
import { useLocation } from 'react-router-dom';
import ShowBreadcrumbs from './Breadcrumbs';
import DateTimeSelector from './DateTimeSelection';
import { Container } from './styles';
const routesToSkip = [ROUTES.SETTINGS];
const TopNav = (): JSX.Element | null => {
const { pathname } = useLocation();
if (history.location.pathname === ROUTES.SIGN_UP) {
return null;
}
return (
<Container>
<Col span={16}>
<ShowBreadcrumbs />
</Col>
{!routesToSkip.includes(pathname) && (
<Col span={8}>
<DateTimeSelector />
</Col>
)}
</Container>
);
};
export default TopNav;