diff --git a/src/app/(main)/contact/page.tsx b/src/app/(main)/contact/page.tsx deleted file mode 100644 index 88a0474..0000000 --- a/src/app/(main)/contact/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import Contact from "@/components/Contacts/Contact"; -import ContactForm from "@/components/Contacts/ContactForm"; -import HeroOther from "@/components/HeroOther"; -import { Suspense } from "react"; - -export const metadata = { - title: "Contact - Cochise Oncology", - description: "Contact - Cochise Oncology", -}; - -export default async function ContactPage() { - return ( - <> - - -
- - }> - - -
- - ); -} diff --git a/src/blocks/Contact.ts b/src/blocks/Contact.ts new file mode 100644 index 0000000..bfdd32e --- /dev/null +++ b/src/blocks/Contact.ts @@ -0,0 +1,7 @@ +import { Block } from "payload"; + +export const ContactBlock: Block = { + slug: "contactBlock", + labels: { plural: "Contacts", singular: "Contacts" }, + fields: [], +}; diff --git a/src/collections/Pages.ts b/src/collections/Pages.ts index b5d4bff..fec04fe 100644 --- a/src/collections/Pages.ts +++ b/src/collections/Pages.ts @@ -1,6 +1,8 @@ import { BeforeFooterBlock } from "@/blocks/BeforeFooter"; import { BoxMenuGridBlock } from "@/blocks/BoxMenuGrid"; +import { ContactBlock } from "@/blocks/Contact"; import { ContentBlock } from "@/blocks/Content"; +import { FormBlock } from "@/blocks/Form"; import { GoogleReviewBlock } from "@/blocks/GoogleReview"; import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent"; import { ImageSliderBlock } from "@/blocks/ImageSlider"; @@ -47,6 +49,8 @@ export const Pages: CollectionConfig = { ImageSliderBlock, BoxMenuGridBlock, GoogleReviewBlock, + ContactBlock, + FormBlock, ], }, { diff --git a/src/components/Blocks/Contact/index.tsx b/src/components/Blocks/Contact/index.tsx new file mode 100644 index 0000000..85069be --- /dev/null +++ b/src/components/Blocks/Contact/index.tsx @@ -0,0 +1,284 @@ +import { fetchContact } from "@/services/payload/contact"; +import { Suspense } from "react"; + +export default function ContactBlock() { + return ( + <> + }> + + + + ); +} + +async function ContactWithData() { + const contact = await fetchContact(); + + return ( +
+
+
+
+
+

Contact Us

+
+
+
+
+
+
+ {/* Contact Form */} +
+ {/* Contact Item */} +
+
+
+ +
+ +

Location

+ +
+
+ {/* End Contact Item */} + {/* Contact Item */} +
+
+
+ +
+

Phone

+ +
+
+ {/* End Contact Item */} +
+
+ {/* Contact Item */} +
+
+
+ +
+

Hours

+
+ {Array.isArray(contact?.hours) && + contact.hours.map((h) => ( +

+ {h.hour ?? ""} +

+ ))} +
+
+
+ {/* End Contact Item */} + {/* Contact Item */} +
+
+
+ +
+

Fax

+ +
+
+ {/* End Contact Item */} +
+ {/* End Contact Form */} +
+
+ {/* Google Map */} +
+