Skip to content

Commit

Permalink
Merge pull request #656 from CodeForAfrica/fix/codeforafrica_feedback
Browse files Browse the repository at this point in the history
Address codeforafrica feedback
  • Loading branch information
kilemensi authored Dec 4, 2023
2 parents 3da3d01 + cc4b127 commit a890654
Show file tree
Hide file tree
Showing 35 changed files with 1,900 additions and 1,733 deletions.
18 changes: 9 additions & 9 deletions apps/charterafrica/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"db-rollback": "migrate-mongo down"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.461.0",
"@aws-sdk/lib-storage": "^3.461.0",
"@aws-sdk/client-s3": "^3.465.0",
"@aws-sdk/lib-storage": "^3.465.0",
"@commons-ui/core": "workspace:*",
"@commons-ui/next": "workspace:*",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.18",
"@mui/utils": "^5.14.18",
"@mui/material": "^5.14.19",
"@mui/utils": "^5.14.19",
"@next/env": "^14.0.3",
"@nivo/core": "^0.80.0",
"@nivo/pie": "^0.80.0",
Expand All @@ -54,7 +54,7 @@
"@payloadcms/plugin-cloud-storage": "^1.1.1",
"@payloadcms/plugin-nested-docs": "^1.0.9",
"@payloadcms/plugin-seo": "^1.0.15",
"@sentry/nextjs": "^7.83.0",
"@sentry/nextjs": "^7.84.0",
"airtable": "^0.12.2",
"dotenv": "^16.3.1",
"express": "^4.18.2",
Expand Down Expand Up @@ -87,12 +87,12 @@
"@commons-ui/testing-library": "workspace:*",
"@playwright/test": "^1.40.1",
"@svgr/webpack": "^8.1.0",
"@swc/core": "^1.3.99",
"@swc/core": "^1.3.100",
"@types/express": "^4.17.21",
"@types/node": "^18.18.13",
"@types/react": "^18.2.39",
"@types/node": "^18.19.2",
"@types/react": "^18.2.41",
"babel-jest": "^29.7.0",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"eslint-config-commons-ui": "workspace:*",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-import": "^2.29.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ exports[`<Articles /> renders unchanged 1`] = `
aria-hidden="true"
aria-invalid="false"
class="MuiSelect-nativeInput css-yf8vq0-MuiSelect-nativeInput"
name=":r1:"
tabindex="-1"
value="-publishedOn"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/codeforafrica/contrib/dokku/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM codeforafrica/codeforafrica-ui:1.0.51
FROM codeforafrica/codeforafrica-ui:1.0.52
14 changes: 7 additions & 7 deletions apps/codeforafrica/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeforafrica",
"version": "1.0.51",
"version": "1.0.52",
"private": true,
"author": "Code for Africa <[email protected]>",
"description": "This is the main CFA site.",
Expand Down Expand Up @@ -40,8 +40,8 @@
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@googlemaps/react-wrapper": "^1.1.35",
"@mui/material": "^5.14.18",
"@mui/utils": "^5.14.18",
"@mui/material": "^5.14.19",
"@mui/utils": "^5.14.19",
"@next/env": "~14.0.3",
"@payloadcms/plugin-cloud-storage": "^1.1.1",
"@payloadcms/plugin-nested-docs": "^1.0.9",
Expand All @@ -52,7 +52,7 @@
"fast-equals": "^5.0.1",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"jsdom": "^23.0.0",
"jsdom": "^23.0.1",
"next": "^14.0.3",
"next-seo": "^6.4.0",
"nodemailer-sendgrid": "^1.0.3",
Expand All @@ -73,10 +73,10 @@
"@playwright/test": "^1.40.1",
"@svgr/webpack": "^8.1.0",
"@types/express": "^4.17.21",
"@types/node": "^18.18.13",
"@types/react": "^18.2.39",
"@types/node": "^18.19.2",
"@types/react": "^18.2.41",
"babel-jest": "^29.7.0",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"eslint-config-commons-ui": "workspace:*",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-import": "^2.29.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/codeforafrica/src/assets/close-button.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function ArticlePage({
md: "912px",
},
px: { xs: 2.5, sm: 0 },
pt: { xs: 2.5, md: 7.5 },
}}
/>
<CMSContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`<ArticlePage /> renders unchanged 1`] = `
/>
</figure>
<header
class="MuiContainer-root MuiContainer-maxWidthLg MuiContainer-fixed MuiContainer-disableGutters css-12qr4r4-MuiContainer-root"
class="MuiContainer-root MuiContainer-maxWidthLg MuiContainer-fixed MuiContainer-disableGutters css-cnnhfl-MuiContainer-root"
>
<div
class="MuiTypography-root MuiTypography-body2 css-1jq7s7e-MuiTypography-root"
Expand Down
39 changes: 24 additions & 15 deletions apps/codeforafrica/src/components/MobileNavBar/MobileNavBar.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Dialog, DialogContent, Grid, Slide } from "@mui/material";
import {
Dialog,
DialogContent,
Grid,
IconButton,
Slide,
SvgIcon,
} from "@mui/material";
import { styled } from "@mui/material/styles";
import PropTypes from "prop-types";
import React from "react";

import closebutton from "@/codeforafrica/assets/close-button.svg?url";
import CloseIcon from "@/codeforafrica/assets/icons/Type=x, Size=24, Color=CurrentColor.svg";
import menuIcon from "@/codeforafrica/assets/menu-icon.svg?url";
import NavBarNavList from "@/codeforafrica/components/NavBarNavList";
import NextImageButton from "@/codeforafrica/components/NextImageButton";
Expand All @@ -16,7 +23,7 @@ const DialogContainer = styled(Dialog)(({ theme: { palette, spacing } }) => ({
background: "transparent",
},
"& .MuiDialogContent-root": {
padding: spacing(2),
padding: spacing(5),
color: palette.text.secondary,
background: palette.primary.main,
},
Expand Down Expand Up @@ -74,26 +81,28 @@ const MobileNavBar = React.forwardRef(function MobileNavBar(props, ref) {
id="mobile-navbar-dialog"
sx={{
m: 0,
p: 2,
p: 0,
display: "flex",
color: "inherit",
justifyContent: "space-between",
alignItems: "flex-start",
}}
onClose={handleClose}
>
<NavBarNavList menus={menus} socialLinks={socialLinks} />
<NextImageButton
src={closebutton}
alt="Logo"
width={32}
height={32}
sx={{
display: "flex",
marginTop: "1rem",
}}
onClick={handleClose}
<NavBarNavList
menus={menus}
socialLinks={socialLinks}
NavListItemProps={{ onClick: handleClose }}
/>
<IconButton color="inherit" onClick={handleClose} sx={{ p: 0 }}>
<SvgIcon
component={CloseIcon}
sx={{
fill: { xs: "none" },
fontSize: 32,
}}
/>
</IconButton>
</DialogContent>
</DialogContainer>
</Grid>
Expand Down
33 changes: 26 additions & 7 deletions apps/codeforafrica/src/components/NavBarNavList/NavBarNavList.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,35 @@ const platformToIconMap = {
};

const NavBarNavList = React.forwardRef(function NavBarNavList(props, ref) {
const { direction, menus, socialLinks, ...other } = props;
const { NavListItemProps, direction, menus, socialLinks, ...other } = props;

if (!menus?.length) {
return null;
}
return (
<NavList direction={direction} {...other} ref={ref}>
{menus.map((item) => (
<NavListItem key={item.label} sx={{ m: "20px" }}>
<NavListItem
key={item.label}
sx={{
mb: { xs: 2.5, md: 0 },
mr: { xs: 0, md: 2.5 },
}}
>
<Link
href={item.href}
color="inherit"
underline="none"
variant="h4"
// in mobile h3 = h4 in desktop
variant="h3"
{...NavListItemProps}
href={item.href}
sx={{
typography: { md: "body3" },
"&:hover, &:active, &:focus, &:focus-within": {
textDecoration: "none",
color: { xs: "inherit", md: "primary.main" },
},
...NavListItemProps?.sx,
}}
>
{item.label}
Expand All @@ -54,13 +63,21 @@ const NavBarNavList = React.forwardRef(function NavBarNavList(props, ref) {
return null;
}
return (
<NavListItem key={platform} sx={{ m: "20px", mr: 0 }}>
<Link href={url} sx={{ color: { xs: "inherit" } }}>
<NavListItem key={platform}>
<Link
href={url}
variant="h3"
sx={{
color: { xs: "inherit" },
typography: { md: "h5" },
}}
>
<SvgIcon
component={Icon}
fontSize="inherit"
sx={{
mt: direction === "column" ? 0 : 1,
fill: { xs: "none" },
mt: direction === "column" ? 0 : 1,
}}
/>
</Link>
Expand All @@ -72,6 +89,7 @@ const NavBarNavList = React.forwardRef(function NavBarNavList(props, ref) {
});

NavBarNavList.propTypes = {
NavListItemProps: PropTypes.shape({}),
direction: PropTypes.string,
menus: PropTypes.arrayOf(
PropTypes.shape({
Expand All @@ -82,6 +100,7 @@ NavBarNavList.propTypes = {
};

NavBarNavList.defaultProps = {
NavListItemProps: undefined,
direction: undefined,
menus: undefined,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,84 +6,84 @@ exports[`<NavBarNavList /> renders unchanged 1`] = `
class="css-f15emd"
>
<li
class="css-1n7p56k"
class="css-lvozse"
>
<a
class="MuiTypography-root MuiTypography-h4 MuiLink-root MuiLink-underlineNone css-eeqtvc-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineNone css-1gzg4jk-MuiTypography-root-MuiLink-root"
href="/our-work"
>
Our Work
</a>
</li>
<li
class="css-1n7p56k"
class="css-lvozse"
>
<a
class="MuiTypography-root MuiTypography-h4 MuiLink-root MuiLink-underlineNone css-eeqtvc-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineNone css-1gzg4jk-MuiTypography-root-MuiLink-root"
href="/about"
>
About
</a>
</li>
<li
class="css-1n7p56k"
class="css-lvozse"
>
<a
class="MuiTypography-root MuiTypography-h4 MuiLink-root MuiLink-underlineNone css-eeqtvc-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineNone css-1gzg4jk-MuiTypography-root-MuiLink-root"
href="/about"
>
Stories
</a>
</li>
<li
class="css-1n7p56k"
class="css-lvozse"
>
<a
class="MuiTypography-root MuiTypography-h4 MuiLink-root MuiLink-underlineNone css-eeqtvc-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineNone css-1gzg4jk-MuiTypography-root-MuiLink-root"
href="/opportunity"
>
Opportunity
</a>
</li>
<li
class="css-1n7p56k"
class="css-lvozse"
>
<a
class="MuiTypography-root MuiTypography-h4 MuiLink-root MuiLink-underlineNone css-eeqtvc-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineNone css-1gzg4jk-MuiTypography-root-MuiLink-root"
href="/contact"
>
Contact
</a>
</li>
<li
class="css-14eadhm"
class="css-o9b79t"
>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1pxleca-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineAlways css-14ndlm4-MuiTypography-root-MuiLink-root"
href="https://www.facebook.com/CodeForAfrica"
rel="noreferrer noopener"
target="_blank"
>
<div
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-o1xeqk-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-1yelrcy-MuiSvgIcon-root"
focusable="false"
viewbox="0 0 24 24"
/>
</a>
</li>
<li
class="css-14eadhm"
class="css-o9b79t"
>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1pxleca-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-h3 MuiLink-root MuiLink-underlineAlways css-14ndlm4-MuiTypography-root-MuiLink-root"
href="https://twitter.com/Code4Africa"
rel="noreferrer noopener"
target="_blank"
>
<div
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-o1xeqk-MuiSvgIcon-root"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-1yelrcy-MuiSvgIcon-root"
focusable="false"
viewbox="0 0 24 24"
/>
Expand Down
Loading

0 comments on commit a890654

Please sign in to comment.