diff --git a/frontend/src/components/projectDetail/downloadOsmData.js b/frontend/src/components/projectDetail/downloadOsmData.js index 569074c1c8..6f31cf8d4f 100644 --- a/frontend/src/components/projectDetail/downloadOsmData.js +++ b/frontend/src/components/projectDetail/downloadOsmData.js @@ -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 ( 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; + } + })}