From c05451933538872d7c83a700862c541b50429295 Mon Sep 17 00:00:00 2001 From: Deepak Pradhan Date: Wed, 14 Feb 2024 22:48:50 +0545 Subject: [PATCH] feat: queryset added based on isMapshown for omitmapresults --- frontend/src/components/projects/projectNav.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/projects/projectNav.js b/frontend/src/components/projects/projectNav.js index 73722c01d2..7b9d32033e 100644 --- a/frontend/src/components/projects/projectNav.js +++ b/frontend/src/components/projects/projectNav.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; import { useSelector, useDispatch } from 'react-redux'; @@ -84,7 +84,18 @@ export const ProjectNav = (props) => { const encodedParams = stringify(fullProjectsQuery) ? ['?', stringify(fullProjectsQuery)].join('') : ''; + const isMapShown = useSelector((state) => state.preferences['mapShown']); + useEffect(() => { + setQuery( + { + ...fullProjectsQuery, + omitMapResults:!isMapShown + }, + 'pushIn', + ); + // eslint-disable-next-line react-hooks/exhaustive-deps + },[isMapShown]) const linkCombo = 'link ph3 f6 pv2 ba b--tan br1 ph3 fw5'; const moreFiltersAnyActive =