Skip to content

Commit

Permalink
Remove unused Styles from Mobile Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Dec 5, 2024
1 parent a91b6fb commit 1a664e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 43 deletions.
3 changes: 2 additions & 1 deletion apps/climatemappedafrica/src/components/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid, Typography } from "@mui/material";
import PropTypes from "prop-types";
import React from "react";

function Menu({ children, explorePagePath, links, socialLinks }) {
function Menu({ children, explorePagePath, links, socialLinks, LinkProps }) {
if (!links?.length) {
return null;
}
Expand Down Expand Up @@ -60,6 +60,7 @@ function Menu({ children, explorePagePath, links, socialLinks }) {
padding: `${typography.pxToRem(16)} ${typography.pxToRem(30)} `,
border: "1px solid",
},
...LinkProps,
})}
>
<Typography
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
IconButton,
DialogContent,
SvgIcon,
useTheme,
} from "@mui/material";
import makeStyles from "@mui/styles/makeStyles";
import { useRouter } from "next/router";
import PropTypes from "prop-types";
import React, { useState } from "react";
Expand All @@ -20,38 +20,6 @@ import Menu from "@/climatemappedafrica/components/Menu";
import NextImageButton from "@/climatemappedafrica/components/NextImageButton";
import Section from "@/climatemappedafrica/components/Section";

const useStyles = makeStyles(({ breakpoints, typography, palette }) => ({
label: {
[breakpoints.up("lg")]: {
fontWeight: 600,
letterSpacing: "1.6px",
fontSize: typography.pxToRem(20),
},
},
buttonMenu: {
margin: 0,
},
links: {
display: "inline-block",
},
menuLinks: {
color: palette.text.secondary,
display: "inline-block",
margin: `${typography.pxToRem(10)} 0`,
"&:hover, &:focus, &:focus-within": {
backgroundColor: "transparent",
textDecoration: "none",
color: palette.text.secondary,
},
},
mainMenu: {
[breakpoints.up("lg")]: {
flexDirection: "column",
justifyContent: "flex-start",
},
},
}));

const Transition = React.forwardRef(function Transition(props, ref) {
return <Slide direction="left" timeout={1000} ref={ref} {...props} />;
});
Expand All @@ -65,9 +33,9 @@ function MobileNavigation({
sx,
...props
}) {
const classes = useStyles(props);
const [open, setOpen] = useState(false);
const router = useRouter();
const theme = useTheme();

const handleClickOpen = (e) => {
e?.preventDefault();
Expand Down Expand Up @@ -103,8 +71,8 @@ function MobileNavigation({
aria-label="Open drawer"
size="medium"
onClick={handleClickOpen}
sx={(theme) => ({
color: theme.palette.grey.dark,
sx={({ palette }) => ({
color: palette.grey.dark,
padding: 0,
})}
>
Expand Down Expand Up @@ -189,12 +157,9 @@ function MobileNavigation({
explorePagePath={explorePagePath}
links={menus}
socialLinks={socialLinks}
classes={{
root: classes.mainMenu,
links: classes.links,
menuLinks: classes.menuLinks,
label: classes.label,
menu: classes.buttonMenu,
LinkProps={{
padding: 0,
margin: `${theme.typography.pxToRem(10)} 0`,
}}
>
<DropdownSearch
Expand Down

0 comments on commit 1a664e0

Please sign in to comment.