Skip to content

Commit

Permalink
Merge branch 'main' into fix/roboshield-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
m453h committed Jul 16, 2024
2 parents b7dc142 + f57570d commit d34595b
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 224 deletions.
2 changes: 1 addition & 1 deletion apps/charterafrica/contrib/dokku/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM codeforafrica/charterafrica-ui:0.1.29
FROM codeforafrica/charterafrica-ui:0.1.30
2 changes: 1 addition & 1 deletion apps/charterafrica/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "charterafrica",
"version": "0.1.29",
"version": "0.1.30",
"private": true,
"author": "Code for Africa <[email protected]>",
"description": "This is the official code for https://charter.africa site",
Expand Down
2 changes: 1 addition & 1 deletion apps/charterafrica/src/components/Spotlight/Spotlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Spotlight = React.forwardRef(function Spotlight(props, ref) {
<CardMedia
alt={item.title}
component="img"
src={item.image.src}
src={item.image.url}
sx={{
height: {
xs: "auto",
Expand Down
3 changes: 2 additions & 1 deletion apps/charterafrica/src/lib/data/common/processPageIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ const processSpotlight = (page, api, context) => {
const { item: itemData, ...rest } = item;
return {
...rest,
category: rest?.category || null,
item: {
...itemData,
image: {
src: itemData.image.url,
alt: itemData.image.alt,
url: itemData.image.url,
},
date: new Date(itemData.date).toLocaleDateString(locale, {
year: "numeric",
Expand Down
8 changes: 8 additions & 0 deletions apps/charterafrica/src/payload/collections/Media.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ const Media = {
required: true,
},
],
hooks: {
afterRead: [
({ doc }) => ({
...doc,
alt: doc.alt ?? null,
}),
],
},
};

export default Media;
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { LocationTag } from "@hurumap/core";
import { LocationTag, LocationHighlight } from "@hurumap/core";
import { Box } from "@mui/material";
import clsx from "clsx";
import PropTypes from "prop-types";

import useStyles from "./useStyles";

import LocationHighlight from "@/climatemappedafrica/components/HURUmap/LocationHighlight";

function Location({ className, highlights, isLoading, tags, ...props }) {
const classes = useStyles(props);

Expand Down Expand Up @@ -53,11 +51,12 @@ function Location({ className, highlights, isLoading, tags, ...props }) {
key={highlight.title}
isLoading={isLoading}
{...highlight}
classes={{
root: classes.highlight,
title: classes.highlightTitle,
value: classes.highlightValue,
}}
sx={(theme) => ({
paddingTop: "4.5px",
"&:not(:first-of-type)": {
borderLeft: `1px solid ${theme.palette.grey.main}`,
},
})}
/>
))}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const useStyles = makeStyles(({ palette, typography }) => ({
marginTop: 4.5,
width: "100%",
},
highlight: {
paddingTop: 4.5,
"&:not(:first-of-type)": {
borderLeft: `1px solid ${palette.grey.main}`,
},
},
highlightTitle: {},
highlightValue: {},
}));

export default useStyles;

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 7 additions & 8 deletions apps/pesayetu/src/components/HURUmap/Location/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { LocationTag } from "@hurumap/core";
import { LocationTag, LocationHighlight } from "@hurumap/core";
import { Box } from "@mui/material";
import clsx from "clsx";
import PropTypes from "prop-types";

import useStyles from "./useStyles";

import LocationHighlight from "@/pesayetu/components/HURUmap/LocationHighlight";

function Location({ className, highlights, isLoading, tags, ...props }) {
const classes = useStyles(props);

Expand Down Expand Up @@ -53,11 +51,12 @@ function Location({ className, highlights, isLoading, tags, ...props }) {
key={highlight.title}
isLoading={isLoading}
{...highlight}
classes={{
root: classes.highlight,
title: classes.highlightTitle,
value: classes.highlightValue,
}}
sx={(theme) => ({
paddingTop: "4.5px",
"&:not(:first-of-type)": {
borderLeft: `1px solid ${theme.palette.grey.main}`,
},
})}
/>
))}
</Box>
Expand Down
8 changes: 0 additions & 8 deletions apps/pesayetu/src/components/HURUmap/Location/useStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const useStyles = makeStyles(({ palette, typography }) => ({
marginTop: 4.5,
width: "100%",
},
highlight: {
paddingTop: 4.5,
"&:not(:first-of-type)": {
borderLeft: `1px solid ${palette.grey.main}`,
},
},
highlightTitle: {},
highlightValue: {},
}));

export default useStyles;
58 changes: 0 additions & 58 deletions apps/pesayetu/src/components/HURUmap/LocationHighlight/index.js

This file was deleted.

This file was deleted.

This file was deleted.

39 changes: 39 additions & 0 deletions apps/uibook/stories/HURUmap/core/LocationHighlight.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { LocationHighlight } from "@hurumap/core";
import React from "react";

const highlights = [
{
title: "Population",
value: "1,000,000",
},
{
title: "GDP",
value: "1,000,000",
},
{
title: "Area",
value: "1,000,000",
},
];

export default {
title: "@hurumap/core/LocationHighlight",
argTypes: {
isLoading: {
control: {
type: "boolean",
},
},
},
};

function Template({ ...args }) {
return <LocationHighlight {...args} />;
}

export const Default = Template.bind({});

Default.args = {
isLoading: false,
...highlights[0],
};
Loading

0 comments on commit d34595b

Please sign in to comment.