From e4820b0ba47337b793af416b6237475d2678812f Mon Sep 17 00:00:00 2001 From: Deepak Pradhan Date: Mon, 29 Jan 2024 17:50:28 +0545 Subject: [PATCH 1/2] fix: disable exhaustive deps rules --- frontend/src/components/projectDetail/downloadOsmData.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/projectDetail/downloadOsmData.js b/frontend/src/components/projectDetail/downloadOsmData.js index 569074c1c8..d8cdfcc994 100644 --- a/frontend/src/components/projectDetail/downloadOsmData.js +++ b/frontend/src/components/projectDetail/downloadOsmData.js @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; -import { RoadIcon, HomeIcon, WavesIcon, TaskIcon, DownloadIcon, InfoIcon } from '../svgIcons'; +import { RoadIcon, HomeIcon, WavesIcon, TaskIcon, DownloadIcon } from '../svgIcons'; import FileFormatCard from './fileFormatCard'; import Popup from 'reactjs-popup'; import { EXPORT_TOOL_S3_URL } from '../../config'; @@ -104,6 +104,7 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => { projectMappingTypes?.includes(icon.value), ); setDownloadDataList(filteredMappingTypes); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [projectMappingTypes]); useEffect(() => { @@ -184,6 +185,7 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => { }); }; multipleHeadCallForFormat(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedCategoryFormat]); return ( From 503c3b8d55be6518cec42c10973990686b9ed16d Mon Sep 17 00:00:00 2001 From: Deepak Pradhan Date: Tue, 30 Jan 2024 09:19:58 +0545 Subject: [PATCH 2/2] feat(footer): add condition to make footer detail visible --- .../src/components/projectDetail/footer.js | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/projectDetail/footer.js b/frontend/src/components/projectDetail/footer.js index a14f13abd6..c3c5c9899c 100644 --- a/frontend/src/components/projectDetail/footer.js +++ b/frontend/src/components/projectDetail/footer.js @@ -10,39 +10,48 @@ import { AddToFavorites } from './favorites'; import { HorizontalScroll } from '../horizontalScroll'; import './styles.scss'; +import { ENABLE_EXPORT_TOOL } from '../../config'; const menuItems = [ { href: '#top', label: , + isVisibleCondition: true, }, { href: '#description', label: , + isVisibleCondition: true, }, { href: '#coordination', label: , + isVisibleCondition: true, }, { href: '#teams', label: , + isVisibleCondition: true, }, { href: '#questionsAndComments', label: , + isVisibleCondition: true, }, { href: '#contributions', label: , + isVisibleCondition: true, }, { href: '#downloadOsmData', label: , + isVisibleCondition: +ENABLE_EXPORT_TOOL === 1, }, { href: '#similarProjects', label: , + isVisibleCondition: true, }, ]; @@ -64,14 +73,20 @@ export const ProjectDetailFooter = ({ className, projectId }) => { containerClass={'.menu-items-container'} >
- {menuItems.map((menuItem, index) => ( - - - {menuItem.label} - - {index < menuItems.length - 1 && ·} - - ))} + {menuItems.map((menuItem, index) => { + if (menuItem.isVisibleCondition) { + return ( + + + {menuItem.label} + + {index < menuItems.length - 1 && ·} + + ); + } else { + return null; + } + })}