From 036167b5ef650fe4367f3d4bb34aab8d7b591f44 Mon Sep 17 00:00:00 2001 From: Muhammad Talha Baig <57634631+mtalhabaig3@users.noreply.github.com> Date: Wed, 21 Jun 2023 17:20:31 +0500 Subject: [PATCH 01/30] made the main page static and enabled scrolling in the filters component --- frontend/src/views/project.css | 3 +++ frontend/src/views/project.js | 26 +++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 frontend/src/views/project.css diff --git a/frontend/src/views/project.css b/frontend/src/views/project.css new file mode 100644 index 0000000000..9edce542c6 --- /dev/null +++ b/frontend/src/views/project.css @@ -0,0 +1,3 @@ +.scrollable-container::-webkit-scrollbar { + width: 0; +} diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index 321bbd8826..889fd9426c 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -21,6 +21,7 @@ import { useFetch } from '../hooks/UseFetch'; import { useSetTitleTag } from '../hooks/UseMetaTags'; import { NotFound } from './notFound'; import { ProjectDetailPlaceholder } from '../components/projectDetail/projectDetailPlaceholder'; +import './project.css'; const ProjectCreate = React.lazy(() => import('../components/projectCreate/index')); @@ -152,6 +153,18 @@ export const MoreFilters = () => { const navigate = useNavigate(); const [fullProjectsQuery] = useExploreProjectsQueryParams(); + useEffect(() => { + // Disable scrolling outside the component when it appears + document.body.style.overflow = 'hidden'; + document.documentElement.style.overflow = 'hidden'; + + return () => { + // Restore scrolling when the component is closed + document.body.style.overflow = 'auto'; + document.documentElement.style.overflow = 'auto'; + }; + }, []); + const currentUrl = `/explore${ stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : '' }`; @@ -159,7 +172,18 @@ export const MoreFilters = () => { return ( <>