From ca8afc317ece858b56525d004a51b7ee30da411a Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:25:23 +0300 Subject: [PATCH] get button label from cms --- .../src/components/MeetOurTeam/MeetOurTeam.js | 9 +++++++-- apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/codeforafrica/src/components/MeetOurTeam/MeetOurTeam.js b/apps/codeforafrica/src/components/MeetOurTeam/MeetOurTeam.js index 33b2f02fa..35a199be4 100644 --- a/apps/codeforafrica/src/components/MeetOurTeam/MeetOurTeam.js +++ b/apps/codeforafrica/src/components/MeetOurTeam/MeetOurTeam.js @@ -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; @@ -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} diff --git a/apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js b/apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js index 90a991f78..c539afea4 100644 --- a/apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js +++ b/apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js @@ -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, };