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>
This commit is contained in:
Mohmn 2021-12-02 19:04:13 +05:30 committed by GitHub
parent 8f2ed0e46f
commit 5e828bf174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,12 +2,17 @@ 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;
}
@ -18,9 +23,11 @@ const TopNav = (): JSX.Element | null => {
<ShowBreadcrumbs />
</Col>
<Col span={8}>
<DateTimeSelector />
</Col>
{!routesToSkip.includes(pathname) && (
<Col span={8}>
<DateTimeSelector />
</Col>
)}
</Container>
);
};