Skip to content

Commit

Permalink
get button label from cms
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Sep 15, 2023
1 parent 79e0c5b commit ca8afc3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions apps/codeforafrica/src/components/MeetOurTeam/MeetOurTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import React from "react";
import RichText from "@/codeforafrica/components/RichText";

const MeetOurTeam = React.forwardRef(function MeetOurTeam(props, ref) {
const { title, description, href, image } = props;
const {
title,
description,
action: { href, content },
image,
} = props;

if (!title || !description) {
return null;
Expand Down Expand Up @@ -35,7 +40,7 @@ const MeetOurTeam = React.forwardRef(function MeetOurTeam(props, ref) {
sx={{ width: { xs: "100%", sm: "auto" }, margin: "2.5rem 0" }}
variant="contained-reverse"
>
Meet our Team
{content}
</Button>
</Grid>

Expand Down
7 changes: 5 additions & 2 deletions apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import { imageFromMedia } from "@/codeforafrica/lib/data/utils";
function meetOurTeam(block) {
const { image: media, actionButton, title, ...other } = block;
const image = imageFromMedia({ alt: title, ...media });
const { href } = actionButton;
const { href, label } = actionButton;

return {
...other,
image,
href,
action: {
href,
content: label,
},
slug: "meet-our-team",
title,
};
Expand Down

0 comments on commit ca8afc3

Please sign in to comment.