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 ( <>
- +
+ + +
navigate(currentUrl)} From 88441eaf18bbf42ee52194bf55580de36a059a34 Mon Sep 17 00:00:00 2001 From: Muhammad Talha Baig <57634631+mtalhabaig3@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:54:18 +0500 Subject: [PATCH 02/30] Solved the height issue of filters menu --- frontend/src/assets/styles/_extra.scss | 4 ++ frontend/src/components/header/index.js | 2 +- .../src/components/projects/projectNav.js | 2 +- frontend/src/views/project.css | 3 -- frontend/src/views/project.js | 39 +++++++++++++------ 5 files changed, 33 insertions(+), 17 deletions(-) delete mode 100644 frontend/src/views/project.css diff --git a/frontend/src/assets/styles/_extra.scss b/frontend/src/assets/styles/_extra.scss index 49359a7bc4..c9964e789b 100644 --- a/frontend/src/assets/styles/_extra.scss +++ b/frontend/src/assets/styles/_extra.scss @@ -616,3 +616,7 @@ a[href="https://www.mapbox.com/map-feedback/"] .link:focus { outline: revert; } + +.scrollable-container::-webkit-scrollbar { + width: 0; +} diff --git a/frontend/src/components/header/index.js b/frontend/src/components/header/index.js index 65ab1872f5..49e837a300 100644 --- a/frontend/src/components/header/index.js +++ b/frontend/src/components/header/index.js @@ -89,7 +89,7 @@ export const Header = () => { ) : null; return ( -
+
{checkUserEmail()} {showOrgBar && ( diff --git a/frontend/src/components/projects/projectNav.js b/frontend/src/components/projects/projectNav.js index 73722c01d2..0a8043f336 100644 --- a/frontend/src/components/projects/projectNav.js +++ b/frontend/src/components/projects/projectNav.js @@ -104,7 +104,7 @@ export const ProjectNav = (props) => { // onSelectedItemChange={(changes) => console.log(changes)} return ( /* mb1 mb2-ns (removed for map, but now small gap for more-filters) */ -
+
diff --git a/frontend/src/views/project.css b/frontend/src/views/project.css deleted file mode 100644 index 9edce542c6..0000000000 --- a/frontend/src/views/project.css +++ /dev/null @@ -1,3 +0,0 @@ -.scrollable-container::-webkit-scrollbar { - width: 0; -} diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index 889fd9426c..11bd91a850 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -1,4 +1,4 @@ -import React, { Suspense, useEffect } from 'react'; +import React, { Suspense, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import ReactPlaceholder from 'react-placeholder'; import { Outlet, useLocation, useNavigate, useParams } from 'react-router-dom'; @@ -21,7 +21,6 @@ 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 +151,7 @@ export const ProjectsPageIndex = (props) => { export const MoreFilters = () => { const navigate = useNavigate(); const [fullProjectsQuery] = useExploreProjectsQueryParams(); + const [componentHeight, setComponentHeight] = useState(`${window.innerHeight}px`); useEffect(() => { // Disable scrolling outside the component when it appears @@ -165,22 +165,37 @@ export const MoreFilters = () => { }; }, []); + useEffect(() => { + const contentHeight = + document.getElementById('explore-nav').offsetHeight + + document.getElementById('top-header').offsetHeight; + + const handleResize = () => { + setComponentHeight(window.innerHeight - contentHeight); + }; + + handleResize(); + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; + }); + + console.log(componentHeight); + const currentUrl = `/explore${ stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : '' }`; return ( <> -
-
+
+
From fde0541f40419921df9770e87b53634db1e60912 Mon Sep 17 00:00:00 2001 From: Muhammad Talha Baig <57634631+mtalhabaig3@users.noreply.github.com> Date: Thu, 22 Jun 2023 21:10:10 +0500 Subject: [PATCH 03/30] minor changes --- frontend/src/views/project.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index 11bd91a850..e0b84223ce 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -183,8 +183,6 @@ export const MoreFilters = () => { }; }); - console.log(componentHeight); - const currentUrl = `/explore${ stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : '' }`; @@ -197,7 +195,6 @@ export const MoreFilters = () => { >
-
Date: Fri, 23 Jun 2023 17:16:15 +0500 Subject: [PATCH 04/30] added dependency array --- frontend/src/views/project.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/project.js b/frontend/src/views/project.js index e0b84223ce..fba331da61 100644 --- a/frontend/src/views/project.js +++ b/frontend/src/views/project.js @@ -181,7 +181,7 @@ export const MoreFilters = () => { return () => { window.removeEventListener('resize', handleResize); }; - }); + }, []); const currentUrl = `/explore${ stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : '' From f211ea005a871d2e29ddf472c2154a0ca03989f8 Mon Sep 17 00:00:00 2001 From: Muhammad Talha Baig <57634631+mtalhabaig3@users.noreply.github.com> Date: Wed, 28 Jun 2023 21:13:47 +0500 Subject: [PATCH 05/30] remove the css for hiding scroll bar --- frontend/src/assets/styles/_extra.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/src/assets/styles/_extra.scss b/frontend/src/assets/styles/_extra.scss index c9964e789b..49359a7bc4 100644 --- a/frontend/src/assets/styles/_extra.scss +++ b/frontend/src/assets/styles/_extra.scss @@ -616,7 +616,3 @@ a[href="https://www.mapbox.com/map-feedback/"] .link:focus { outline: revert; } - -.scrollable-container::-webkit-scrollbar { - width: 0; -} From 41d270cbaf88c24e61cb0cbc2678a80b2220db92 Mon Sep 17 00:00:00 2001 From: Muhammad Talha Baig <57634631+mtalhabaig3@users.noreply.github.com> Date: Mon, 10 Jul 2023 20:58:08 +0500 Subject: [PATCH 06/30] Made dropdowns fixed and hide scroll bar --- frontend/src/components/projects/filterSelectFields.js | 1 + frontend/src/views/project.js | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/projects/filterSelectFields.js b/frontend/src/components/projects/filterSelectFields.js index bbc2fb9b50..3da8cde147 100644 --- a/frontend/src/components/projects/filterSelectFields.js +++ b/frontend/src/components/projects/filterSelectFields.js @@ -201,6 +201,7 @@ export const TagFilterPickerAutocomplete = ({ return ( Date: Mon, 15 Apr 2024 22:34:11 +0545 Subject: [PATCH 12/30] Increase padding in more filters footer button in more filter --- frontend/src/components/projects/moreFiltersForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/projects/moreFiltersForm.js b/frontend/src/components/projects/moreFiltersForm.js index 0f54d6494d..4f991ceeab 100644 --- a/frontend/src/components/projects/moreFiltersForm.js +++ b/frontend/src/components/projects/moreFiltersForm.js @@ -116,7 +116,7 @@ export const MoreFiltersForm = (props) => { /> )} -
+