Skip to content

Commit

Permalink
Merge pull request #782 from CodeForAfrica/bugfix/charterafrica-spotl…
Browse files Browse the repository at this point in the history
…ight

Bump charterafrica version to 0.1.30
  • Loading branch information
koechkevin authored Jul 16, 2024
2 parents 97f48fc + d5f56e5 commit 95d7169
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 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 <tech@codeforafrica.org>",
"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;

0 comments on commit 95d7169

Please sign in to comment.