Skip to content

Commit

Permalink
Hide tutorial icon if tutorial is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Nov 7, 2024
1 parent 7cbea73 commit de4fd47
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -83,24 +89,26 @@ function ExploreNavigation({ explorePagePath, locations, logo, variant }) {
menuItem: classes.searchMenuItem,
}}
/>
<Typography
component="div"
id="nav-help"
onClick={openTooltip}
variant="h3"
sx={(theme) => ({
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",
})}
>
?
</Typography>
{tutorialEnabled && (
<Typography
component="div"
id="nav-help"
onClick={openTooltip}
variant="h3"
sx={(theme) => ({
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",
})}
>
?
</Typography>
)}
</Grid>
<Grid />
</Grid>
Expand Down
3 changes: 3 additions & 0 deletions apps/climatemappedafrica/src/lib/data/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -64,6 +66,7 @@ async function getNavBar(variant, settings) {
logo: imageFromMedia(title, primaryLogo.url),
menus,
socialLinks,
tutorialEnabled,
variant,
};
}
Expand Down

0 comments on commit de4fd47

Please sign in to comment.