diff --git a/src/app/(main)/[slug]/page.tsx b/src/app/(main)/[slug]/page.tsx index 0529fe7..ca21879 100644 --- a/src/app/(main)/[slug]/page.tsx +++ b/src/app/(main)/[slug]/page.tsx @@ -1,9 +1,9 @@ import { BlogDetailContentSkeleton } from "@/components/Blogs/BlogDetail"; +import HeroOther from "@/components/HeroOther"; import Page from "@/components/Pages/Page"; import { fetchBlogDetail } from "@/services/payload/blog"; import { fetchPageBySlug } from "@/services/payload/page"; import { Metadata } from "next"; -import Image from "next/image"; import { Suspense } from "react"; export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { @@ -58,13 +58,7 @@ export default async function SinglePage({ params }: { params: Promise<{ slug: s function Loading() { return ( <> -
- {/* */} -
- -
- {/* */} -
+ {/* Section */} diff --git a/src/app/(main)/contact/page.tsx b/src/app/(main)/contact/page.tsx index c7edc76..88a0474 100644 --- a/src/app/(main)/contact/page.tsx +++ b/src/app/(main)/contact/page.tsx @@ -1,6 +1,6 @@ import Contact from "@/components/Contacts/Contact"; import ContactForm from "@/components/Contacts/ContactForm"; -import Image from "next/image"; +import HeroOther from "@/components/HeroOther"; import { Suspense } from "react"; export const metadata = { @@ -11,31 +11,7 @@ export const metadata = { export default async function ContactPage() { return ( <> -
- {/* */} -
- -
- {/* */} - -
-
-
-

Contact Us

- - {/*

- Crafting immersive digital journeys for brands. -

*/} -
-
-
-
+
diff --git a/src/components/Blocks/RenderBlocks.tsx b/src/components/Blocks/RenderBlocks.tsx index 175c76e..eb0092a 100644 --- a/src/components/Blocks/RenderBlocks.tsx +++ b/src/components/Blocks/RenderBlocks.tsx @@ -39,7 +39,7 @@ export const RenderBlocks: React.FC<{ if (blockType === "googleReviewBlock") { return ( -
+
}> @@ -47,14 +47,14 @@ export const RenderBlocks: React.FC<{ ); } else if (blockType === "beforeFooterBlock") { return ( -
+
{/* @ts-ignore */}
); } else { return ( -
+
{/* @ts-ignore */}
diff --git a/src/components/Blogs/BlogDetail.tsx b/src/components/Blogs/BlogDetail.tsx index 166ba0f..2b4c825 100644 --- a/src/components/Blogs/BlogDetail.tsx +++ b/src/components/Blogs/BlogDetail.tsx @@ -1,9 +1,9 @@ +import HeroOther from "@/components/HeroOther"; import { fetchBlogDetail } from "@/services/payload/blog"; import { RichText } from "@payloadcms/richtext-lexical/react"; import { headers } from "next/headers"; import Image from "next/image"; import { notFound } from "next/navigation"; -import { FaFacebook, FaLinkedin, FaTwitter } from "react-icons/fa"; export interface BlogDetailProps { slug: string | undefined; @@ -26,41 +26,7 @@ export default async function BlogDetail({ slug }: BlogDetailProps) { return ( <> -
- {/* */} -
- -
- {/* */} - -
-
-
-

{data.data.title}

- {/* Author, Categories, Comments */} -
- -
- {/* End Author, Categories, Comments */} - - -
-
-
-
+ {/* Section */}
diff --git a/src/components/HeroOther.tsx b/src/components/HeroOther.tsx index 29b2f1c..2299ff3 100644 --- a/src/components/HeroOther.tsx +++ b/src/components/HeroOther.tsx @@ -1,30 +1,57 @@ import Image from "next/image"; +import { FaFacebook, FaLinkedin, FaTwitter } from "react-icons/fa"; export interface HeroOtherProps { - title: string; + title?: string; + img?: string; + createdAt?: string; + shareUrl?: Record; } -export default function HeroOther({ title }: HeroOtherProps) { +const shareIcons: Record = { + facebook: , + linkedin: , + twitter: , +}; + +export default function HeroOther({ title, img, createdAt, shareUrl }: HeroOtherProps) { return ( -
+
{/* */}
- +
{/* */}
-

{title ?? ""}

+

{title ?? ""}

+ {!!createdAt && ( +
+
+ + {createdAt} +
+
+ )} + + {!!shareUrl && ( +
+ {Object.keys(shareUrl).map((k, idx) => { + return ( + + {shareIcons[k]} + + ); + })} +
+ )}
- +
diff --git a/src/components/Pages/Page.tsx b/src/components/Pages/Page.tsx index 89e0cd2..745e4f8 100644 --- a/src/components/Pages/Page.tsx +++ b/src/components/Pages/Page.tsx @@ -2,7 +2,7 @@ import { BeforeFooterBlock } from "@/components/Blocks/BeforeFooter"; import { RenderBlocks } from "@/components/Blocks/RenderBlocks"; import BlogDetail from "@/components/Blogs/BlogDetail"; import { fetchPageBySlug } from "@/services/payload/page"; -import Image from "next/image"; +import HeroOther from "@/components/HeroOther"; export interface PageProps { slug: string | undefined; @@ -22,43 +22,7 @@ export default async function Page({ slug }: PageProps) { return ( <> -
- {/* */} - {!!page.heroImg?.url && ( -
- {page.heroImg.alt} -
- )} - {!page?.heroImg?.url && ( -
- -
- )} - {/* */} - -
-
-
-

{page.title}

-
-
-
-
- + );