From de4fd474887703cc97395900a8959856c472fd50 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:26:23 +0300 Subject: [PATCH] Hide tutorial icon if tutorial is not enabled --- .../Navigation/ExploreNavigation/index.js | 46 +++++++++++-------- .../src/lib/data/common/index.js | 3 ++ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/apps/climatemappedafrica/src/components/Navigation/ExploreNavigation/index.js b/apps/climatemappedafrica/src/components/Navigation/ExploreNavigation/index.js index 45fb42112..31a9f4a2e 100644 --- a/apps/climatemappedafrica/src/components/Navigation/ExploreNavigation/index.js +++ b/apps/climatemappedafrica/src/components/Navigation/ExploreNavigation/index.js @@ -41,7 +41,13 @@ const useStyles = makeStyles(({ palette, typography }) => ({ }, })); -function ExploreNavigation({ explorePagePath, locations, logo, variant }) { +function ExploreNavigation({ + explorePagePath, + locations, + logo, + tutorialEnabled, + variant, +}) { const classes = useStyles(); const { setIsOpen } = useTour(); @@ -83,24 +89,26 @@ function ExploreNavigation({ explorePagePath, locations, logo, variant }) { menuItem: classes.searchMenuItem, }} /> - ({ - color: "#666666", - textAlign: "center", - backgroundColor: "#EBEBEB", - borderRadius: theme.typography.pxToRem(60), - marginLeft: theme.typography.pxToRem(20), - width: theme.typography.pxToRem(48), - height: theme.typography.pxToRem(48), - cursor: "pointer", - })} - > - ? - + {tutorialEnabled && ( + ({ + color: "#666666", + textAlign: "center", + backgroundColor: "#EBEBEB", + borderRadius: theme.typography.pxToRem(60), + marginLeft: theme.typography.pxToRem(20), + width: theme.typography.pxToRem(48), + height: theme.typography.pxToRem(48), + cursor: "pointer", + })} + > + ? + + )} diff --git a/apps/climatemappedafrica/src/lib/data/common/index.js b/apps/climatemappedafrica/src/lib/data/common/index.js index a85cf13b0..2fd23ad29 100644 --- a/apps/climatemappedafrica/src/lib/data/common/index.js +++ b/apps/climatemappedafrica/src/lib/data/common/index.js @@ -50,11 +50,13 @@ async function getNavBar(variant, settings) { const socialLinks = links?.filter((link) => connect.includes(link.platform)); let explorePagePath = null; let locations = null; + let tutorialEnabled; if (hurumap?.enabled) { explorePagePath = hurumap.profilePage.slug; if (hurumap.profile) { locations = hurumap.profile.locations; } + tutorialEnabled = hurumap.tutorial?.enabled; } return { @@ -64,6 +66,7 @@ async function getNavBar(variant, settings) { logo: imageFromMedia(title, primaryLogo.url), menus, socialLinks, + tutorialEnabled, variant, }; }