Skip to content

Commit

Permalink
Fix action button
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Sep 19, 2023
1 parent adcfc58 commit 55f6012
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
7 changes: 1 addition & 6 deletions apps/codeforafrica/src/lib/data/blockify/meetOurTeam.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import {
actionFromActionButton,
imageFromMedia,
} from "@/codeforafrica/lib/data/utils";
import { imageFromMedia } from "@/codeforafrica/lib/data/utils";

function meetOurTeam(block) {
const { image: media, actionButton, title, ...other } = block;
const image = imageFromMedia({ alt: title, ...media });
const action = actionFromActionButton({ ...actionButton });

return {
...other,
image,
action,
slug: "meet-our-team",
title,
};
Expand Down
4 changes: 0 additions & 4 deletions apps/codeforafrica/src/lib/data/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ export function imageFromMedia({ alt = null, url = null }) {
return { alt, src: url };
}

export function actionFromActionButton({ href, label, newTab = false }) {
return { href, label, newTab };
}

export default undefined;
2 changes: 1 addition & 1 deletion apps/codeforafrica/src/payload/blocks/MeetOurTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const MeetOurTeam = {
required: true,
}),
{
name: "actionButton",
name: "action",
label: "Action Button",
type: "group",
fields: [
Expand Down

0 comments on commit 55f6012

Please sign in to comment.