diff --git a/apps/codeforafrica/public/images/cms/blocks/contact_form.jpg b/apps/codeforafrica/public/images/cms/blocks/contact_form.jpg new file mode 100644 index 000000000..06aeb1bc6 Binary files /dev/null and b/apps/codeforafrica/public/images/cms/blocks/contact_form.jpg differ diff --git a/apps/codeforafrica/src/pages/[...slugs].page.js b/apps/codeforafrica/src/pages/[...slugs].page.js index a6bd75087..39ff368e8 100644 --- a/apps/codeforafrica/src/pages/[...slugs].page.js +++ b/apps/codeforafrica/src/pages/[...slugs].page.js @@ -1,6 +1,7 @@ import React from "react"; import { SWRConfig } from "swr"; +import ContactForm from "@/codeforafrica/components/ContactForm"; import CustomPageHeader from "@/codeforafrica/components/CustomPageHeader"; import FeaturedProjects from "@/codeforafrica/components/FeaturedProjects"; import GetInTouch from "@/codeforafrica/components/GetInTouch"; @@ -15,15 +16,16 @@ import Partner from "@/codeforafrica/components/Partner"; import { getPageServerSideProps } from "@/codeforafrica/lib/data"; const componentsBySlugs = { - hero: Hero, + "contact-form": ContactForm, "get-in-touch": GetInTouch, - "page-header": PageHeader, "custom-page-header": CustomPageHeader, + "get-involved": GetInvolved, + hero: Hero, "meet-our-team": MeetOurTeam, "news-stories": NewsAndStories, - "get-involved": GetInvolved, "our-impact": OurImpact, "our-partners": OurPartners, + "page-header": PageHeader, projects: FeaturedProjects, partner: Partner, }; diff --git a/apps/codeforafrica/src/payload/blocks/ContactForm.js b/apps/codeforafrica/src/payload/blocks/ContactForm.js new file mode 100644 index 000000000..cd1e1bd4c --- /dev/null +++ b/apps/codeforafrica/src/payload/blocks/ContactForm.js @@ -0,0 +1,18 @@ +const ContactForm = { + slug: "contact-form", + imageURL: "/images/cms/blocks/contact_form.jpg", + imageAltText: "Contact Form", + fields: [ + { + name: "embedCode", + type: "code", + label: "Embed Code", + required: true, + admin: { + language: "html", + }, + }, + ], +}; + +export default ContactForm; diff --git a/apps/codeforafrica/src/payload/collections/Pages.js b/apps/codeforafrica/src/payload/collections/Pages.js index 41d0fca12..b8a66eef6 100644 --- a/apps/codeforafrica/src/payload/collections/Pages.js +++ b/apps/codeforafrica/src/payload/collections/Pages.js @@ -1,3 +1,4 @@ +import ContactForm from "../blocks/ContactForm"; import CustomPageHeader from "../blocks/CustomPageHeader"; import Error from "../blocks/Error"; import GetInTouch from "../blocks/GetInTouch"; @@ -41,6 +42,7 @@ const Pages = { // it's functiaonally equivalent with PageHeader so we keep it next to // PageHeader blocks: [ + ContactForm, Error, GetInTouch, GetInvolved,