-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from CodeForAfrica/ft/codeforafrica-get-involved
Ft/codeforafrica Get Involved block
- Loading branch information
Showing
12 changed files
with
96 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import formatImpacts from "@/codeforafrica/lib/data/utils/impacts"; | ||
|
||
function getInvolved(block) { | ||
const { impacts, ...other } = block; | ||
const ourImpacts = formatImpacts(impacts); | ||
|
||
return { | ||
...other, | ||
impacts: ourImpacts, | ||
slug: "get-involved", | ||
}; | ||
} | ||
|
||
export default getInvolved; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { imageFromMedia } from "@/codeforafrica/lib/data/utils"; | ||
|
||
export default function formatImpacts(impacts) { | ||
return impacts.map((impact) => { | ||
const { icon: media, title, ...rest } = impact; | ||
const image = imageFromMedia({ alt: title, ...media }); | ||
return { | ||
...rest, | ||
image, | ||
title, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import impacts from "../fields/impacts"; | ||
import linkGroup from "../fields/links/linkGroup"; | ||
|
||
const GetInvolved = { | ||
slug: "get-involved", | ||
imageURL: "/images/cms/blocks/get_involved.jpg", | ||
imageAltText: "Get Involved", | ||
fields: [ | ||
impacts({ | ||
minRows: 3, | ||
maxRows: 3, | ||
}), | ||
linkGroup({ overrides: { name: "action", label: "Action" } }), | ||
], | ||
}; | ||
|
||
export default GetInvolved; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters