diff --git a/package.json b/package.json index 11539f3..a09ccfa 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build": "next build", "start": "next start", "lint": "next lint", + "payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload", "payload:generate:types": "payload generate:types", "tsc": "tsc" }, @@ -65,4 +66,4 @@ "typescript": "^5" }, "packageManager": "yarn@4.6.0" -} +} \ No newline at end of file diff --git a/src/app/(main)/not-found.tsx b/src/app/(main)/not-found.tsx index e2bc124..ef195fa 100644 --- a/src/app/(main)/not-found.tsx +++ b/src/app/(main)/not-found.tsx @@ -16,13 +16,13 @@ export default function NotFound() {
-
+

404

-
+

The page you were looking for could not be found.

-
+
Back To Home Page diff --git a/src/app/(main)/testimonials/page.tsx b/src/app/(main)/testimonials/page.tsx deleted file mode 100644 index b580993..0000000 --- a/src/app/(main)/testimonials/page.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { BeforeFooterBlock } from "@/components/Blocks/BeforeFooter"; -import { GoogleReviewsBlock } from "@/components/Blocks/GoogleReviews"; -import { GoogleReviewsSkeleton } from "@/components/Blocks/GoogleReviews/GoogleReviews"; -import Image from "next/image"; -import { Suspense } from "react"; - -export const metadata = { - title: "Testimonials - Cochise Oncology", - description: "Testimonials - Cochise Oncology", -}; - -export default async function TestimonialsPage() { - return ( - <> -
- {/* */} -
- -
- {/* */} - -
-
-
-

Testimonials

-
-
-
-
-
- }> - - -
- - - ); -} diff --git a/src/blocks/GoogleReview.ts b/src/blocks/GoogleReview.ts new file mode 100644 index 0000000..7fb12de --- /dev/null +++ b/src/blocks/GoogleReview.ts @@ -0,0 +1,7 @@ +import { Block } from "payload"; + +export const GoogleReviewBlock: Block = { + slug: "googleReviewBlock", + labels: { plural: "Google Reviews", singular: "Google Reviews" }, + fields: [], +}; diff --git a/src/collections/Pages.ts b/src/collections/Pages.ts index a47de6d..1287427 100644 --- a/src/collections/Pages.ts +++ b/src/collections/Pages.ts @@ -1,6 +1,7 @@ import { BeforeFooterBlock } from "@/blocks/BeforeFooter"; import { BoxMenuGridBlock } from "@/blocks/BoxMenuGrid"; import { ContentBlock } from "@/blocks/Content"; +import { GoogleReviewBlock } from "@/blocks/GoogleReview"; import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent"; import { ImageSliderBlock } from "@/blocks/ImageSlider"; import { OurTeamBlock } from "@/blocks/OurTeam"; @@ -45,6 +46,7 @@ export const Pages: CollectionConfig = { HorizontalImageContentBlock, ImageSliderBlock, BoxMenuGridBlock, + GoogleReviewBlock, ], }, { diff --git a/src/components/Blocks/GoogleReviews/index.tsx b/src/components/Blocks/GoogleReviews/index.tsx index 750b0ff..5f6e540 100644 --- a/src/components/Blocks/GoogleReviews/index.tsx +++ b/src/components/Blocks/GoogleReviews/index.tsx @@ -1,51 +1,6 @@ import { fetchGoogleReviews } from "@/services/payload/google-reviews"; import { GoogleReviewProps, GoogleReviews } from "./GoogleReviews"; -// const data: CardStarRatingProps["data"][] = [ -// { -// star: 5, -// description: -// "Today i did my cat scan , and met Raymond, he radiates hope and good will, i then met Larry who showed me the hospitality suite, i was overwhelmed by thier kindness, every one i have met so far has been truly amazing.while at physical therapy the doc said i had made a wise", -// }, -// { -// star: 5, -// description: "Great and caring service. Completely satisfied.", -// }, -// { -// star: 5, -// description: "Sincere and caring attitude...very professional and inspires confidence.", -// }, -// { -// star: 5, -// description: -// "I've been going to cochise oncology for many years and everyone is always professional and take the time to explain everything", -// }, -// { -// star: 5, -// description: "One fine person\n Very concerning. Glad to see her", -// }, -// { -// star: 5, -// description: -// "Barbara was very professional and friendly. She shared all info with me and gave me a copy of my lab results.", -// }, -// { -// star: 5, -// description: -// "Barbara is great! She listens and ask questions on other issues outside her area just to be sure you’re well taken care of.", -// }, -// { -// star: 5, -// description: -// "Today, at Cochise Oncology, I had an appointment with Dr. Reid Culton. He explained in great detail from the medical chart of the blood work and listen to my concerns. Dr. Reid Culton also answered my questions in great detail. Thank you.", -// }, -// { -// star: 5, -// description: -// "I absolutely love the people that work at this place. From the front desk to radiation room. Everyone is loving and caring.", -// }, -// ]; - export async function GoogleReviewsBlock() { const data = await fetchGoogleReviews(); if (!data?.id) return <>; diff --git a/src/components/Blocks/HorizontalImageContent/index.tsx b/src/components/Blocks/HorizontalImageContent/index.tsx index e1c7faf..60600cd 100644 --- a/src/components/Blocks/HorizontalImageContent/index.tsx +++ b/src/components/Blocks/HorizontalImageContent/index.tsx @@ -8,7 +8,7 @@ export interface HorizontalImageContentBlockProps { export function HorizontalImageContentBlock({ img, content }: HorizontalImageContentBlockProps) { return ( -
+
{img.alt} diff --git a/src/components/Blocks/RenderBlocks.tsx b/src/components/Blocks/RenderBlocks.tsx index 99bcaf1..175c76e 100644 --- a/src/components/Blocks/RenderBlocks.tsx +++ b/src/components/Blocks/RenderBlocks.tsx @@ -1,4 +1,4 @@ -import React, { Fragment } from "react"; +import React, { Fragment, Suspense } from "react"; import type { Page } from "@/payload-types"; import { ContentBlock } from "./Content"; @@ -7,6 +7,8 @@ import { OurTeamBlock } from "./OurTeam"; import { HorizontalImageContentBlock } from "./HorizontalImageContent"; import { ImageSliderBlock } from "./ImageSlider"; import { BoxMenuGridBlock } from "./BoxMenuGrid"; +import { GoogleReviewsBlock } from "./GoogleReviews"; +import { GoogleReviewsSkeleton } from "./GoogleReviews/GoogleReviews"; const blockComponents = { contentBlock: ContentBlock, @@ -15,6 +17,7 @@ const blockComponents = { horizontalImageContentBlock: HorizontalImageContentBlock, imageSliderBlock: ImageSliderBlock, boxMenuGridBlock: BoxMenuGridBlock, + googleReviewBlock: GoogleReviewsBlock, }; export const RenderBlocks: React.FC<{ @@ -32,10 +35,26 @@ export const RenderBlocks: React.FC<{ if (blockType && blockType in blockComponents) { const Block = blockComponents[blockType]; + if (!Block) return null; - if (Block) { + if (blockType === "googleReviewBlock") { + return ( +
+ }> + + +
+ ); + } else if (blockType === "beforeFooterBlock") { return (
+ {/* @ts-ignore */} + +
+ ); + } else { + return ( +
{/* @ts-ignore */}
diff --git a/src/components/TestimonialsDark.tsx b/src/components/TestimonialsDark.tsx deleted file mode 100644 index d9359f8..0000000 --- a/src/components/TestimonialsDark.tsx +++ /dev/null @@ -1,115 +0,0 @@ -"use client"; -import BrandsDark from "./BrandsDark"; -import { numberItems4 } from "@/data/facts"; -import { testimonials5 } from "@/data/testimonials"; - -import { useEffect, useRef } from "react"; -import Image from "next/image"; -export default function TestimonialsDark() { - const isotopContainer = useRef(null); - const initIsotop = async () => { - const Isotope = (await import("isotope-layout")).default; - const imagesloaded = (await import("imagesloaded")).default; - - // Initialize Isotope in the mounted hook - const isotope = new Isotope(isotopContainer.current, { - itemSelector: ".col-md-6", - layoutMode: "masonry", // or 'fitRows', depending on your layout needs - }); - imagesloaded(isotopContainer.current).on( - "progress", - function () { - // Trigger Isotope layout - isotope.layout(); - } - ); - }; - - useEffect(() => { - ///////////////////////////////////////////////////// - // Magnate Animation - - initIsotop(); - }, []); - return ( -
-
- {/* Section Text */} -
-
-

- Testimonials -

-

- We're trusted by leading companies. -

-

- A static website stores a unique file for every page of a static - website. Each time that page is requested, the same content is - returned. -

- {/* Numbers */} -
- {numberItems4.map((item: any, index: number) => ( -
-
{item.title}
-
{item.description}
-
- ))} -
- {/* End Numbers */} -
-
- {/* End Section Text */} - {/* Testimonials Grid */} -
-
-
- {/* Testimonials Item */} - {testimonials5.map((testimonial: any, index: number) => ( -
-
-
- -
-
-

{testimonial.text}

-
-
- {testimonial.altText} -
-
- {testimonial.author} -
{testimonial.position}
-
-
-
-
-
- ))} - {/* End Testimonials Item */} -
-
-
- {/* Testimonials Grid */} -
- {/* Logotypes */} -
-

Trusted by Leading Companies

- -
- {/* End Logotypes */} -
- ); -} diff --git a/src/payload-types.ts b/src/payload-types.ts index 1e03980..3c9ca6a 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -262,6 +262,11 @@ export interface Page { blockName?: string | null; blockType: 'boxMenuGridBlock'; } + | { + id?: string | null; + blockName?: string | null; + blockType: 'googleReviewBlock'; + } )[] | null; meta?: { @@ -678,6 +683,12 @@ export interface PagesSelect { id?: T; blockName?: T; }; + googleReviewBlock?: + | T + | { + id?: T; + blockName?: T; + }; }; meta?: | T