Skip to content

Commit

Permalink
Remove useStyles from Mobile Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Nov 26, 2024
1 parent 8574274 commit 69faa7c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
20 changes: 8 additions & 12 deletions apps/climatemappedafrica/src/components/Loading/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { Box, CircularProgress } from "@mui/material";
import makeStyles from "@mui/styles/makeStyles";
import React from "react";

const useStyles = makeStyles(({ typography }) => ({
root: {},
box: {
justifyContent: "center",
height: typography.pxToRem(50),
},
}));

function Loading() {
const classes = useStyles();
return (
<Box sx={{ display: "flex" }} className={classes.box}>
<CircularProgress className={classes.progress} />
<Box
sx={({ typography }) => ({
display: "flex",
justifyContent: "center",
height: typography.pxToRem(50),
})}
>
<CircularProgress />
</Box>
);
}
Expand Down
16 changes: 14 additions & 2 deletions apps/climatemappedafrica/src/components/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ function Menu({ children, explorePagePath, links, socialLinks, ...props }) {
alignItems={{ lg: "center" }}
direction={{ xs: "column", lg: "row" }}
justifyContent={{ lg: "flex-end" }}
className={classes.root}
sx={{
padding: {
lg: 0,
},
}}
>
{links.map((item, index) => (
<Grid
Expand Down Expand Up @@ -129,7 +133,15 @@ function Menu({ children, explorePagePath, links, socialLinks, ...props }) {
<Typography
component="span"
variant="body1"
className={classes.label}
sx={({ typography }) => ({
fontWeight: 600,
letterSpacing: "1.6px",
fontSize: {
xs: typography.pxToRem(20),
lg: typography.pxToRem(16),
},
textTransform: "uppercase",
})}
>
{item.label}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ function MobileNavigation({
container
alignItems="center"
justifyContent="space-between"
className={classes.logoSection}
sx={sx}
sx={({ palette, typography }) => ({
borderBottom: `2px solid ${palette.background.default}`,
padding: `${typography.pxToRem(10)} 0`,
...sx,
})}
>
<Grid item xs={10}>
<NextImageButton
Expand Down Expand Up @@ -200,13 +203,21 @@ function MobileNavigation({
TransitionComponent={Transition}
classes={{ root: classes.dialog, paper: classes.dialogPaper }}
>
<DialogActions className={classes.dialogActions}>
<DialogActions
sx={{
padding: 0,
}}
>
<Section className={classes.section}>
<Grid
container
alignItems="center"
justifyContent="space-between"
className={classes.logoSection}
sx={({ palette, typography }) => ({
borderBottom: `2px solid ${palette.background.default}`,
padding: `${typography.pxToRem(10)} 0`,
...sx,
})}
>
<Grid item xs={10}>
<NextImageButton
Expand Down Expand Up @@ -239,7 +250,12 @@ function MobileNavigation({
</Grid>
</Section>
</DialogActions>
<DialogContent className={classes.dialogContent}>
<DialogContent
sx={({ typography }) => ({
overflow: "hidden",
padding: `${typography.pxToRem(40)} 0`,
})}
>
<Section className={classes.section}>
<Menu
explorePagePath={explorePagePath}
Expand Down

0 comments on commit 69faa7c

Please sign in to comment.