Skip to content

Commit

Permalink
Merge pull request #589 from CodeForAfrica/ft/codeforafrica-contact-form
Browse files Browse the repository at this point in the history
Ft/codeforafrica contact form
  • Loading branch information
kelvinkipruto authored Sep 21, 2023
2 parents f92cd24 + 842011d commit ad0735b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions apps/codeforafrica/src/pages/[...slugs].page.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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,
};
Expand Down
18 changes: 18 additions & 0 deletions apps/codeforafrica/src/payload/blocks/ContactForm.js
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions apps/codeforafrica/src/payload/collections/Pages.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ContactForm from "../blocks/ContactForm";
import CustomPageHeader from "../blocks/CustomPageHeader";
import Error from "../blocks/Error";
import GetInTouch from "../blocks/GetInTouch";
Expand Down Expand Up @@ -41,6 +42,7 @@ const Pages = {
// it's functiaonally equivalent with PageHeader so we keep it next to
// PageHeader
blocks: [
ContactForm,
Error,
GetInTouch,
GetInvolved,
Expand Down

0 comments on commit ad0735b

Please sign in to comment.