From 8fd3b43cb4f1cd618f3300af08d192c1c90e0c24 Mon Sep 17 00:00:00 2001
From: Val <44112412+LawfaL@users.noreply.github.com>
Date: Thu, 13 Feb 2025 23:25:31 +0700
Subject: [PATCH] fix: lint
---
src/app/(main)/biography/[slug]/page.tsx | 96 ++++++++++++++++++++++++
src/app/(main)/biography/page.tsx | 0
src/app/(main)/layout.tsx | 23 ------
src/components/HeaderNav.tsx | 2 -
src/components/Homepage.tsx | 4 +-
src/components/SplashScreen.tsx | 52 -------------
src/services/payload/team.ts | 27 +++++++
7 files changed, 125 insertions(+), 79 deletions(-)
create mode 100644 src/app/(main)/biography/[slug]/page.tsx
delete mode 100644 src/app/(main)/biography/page.tsx
create mode 100644 src/services/payload/team.ts
diff --git a/src/app/(main)/biography/[slug]/page.tsx b/src/app/(main)/biography/[slug]/page.tsx
new file mode 100644
index 0000000..5ba0222
--- /dev/null
+++ b/src/app/(main)/biography/[slug]/page.tsx
@@ -0,0 +1,96 @@
+import { BeforeFooterBlock } from "@/components/Blocks/BeforeFooter";
+import { fetchTeamDetail } from "@/services/payload/team";
+import { RichText } from "@payloadcms/richtext-lexical/react";
+import Image from "next/image";
+import { Suspense } from "react";
+
+export default async function BiographySinglePage({ params }: { params: Promise<{ slug: string }> }) {
+ const slug = (await params).slug;
+ const data = await fetchTeamDetail(slug);
+ if (!data?.data) return <>>;
+ return (
+ <>
+ }>
+ <>
+
+ {/* */}
+
+
+
+ {/* */}
+
+
+
+
+
{data.data.name}
+ {/* Author, Categories, Comments */}
+
+ {/* End Author, Categories, Comments */}
+
+
+
+
+
+ {/* Section */}
+
+
+
+ {/* Content */}
+
+ {/* Post */}
+
+ {/* End Post */}
+
+ {/* End Content */}
+
+
+
+ {/* End Section */}
+ >
+
+
+ >
+ );
+}
+
+function Loading() {
+ return (
+
+
+
+ {/* Content */}
+
+ {/* Post */}
+
+ {/* End Post */}
+
+ {/* End Content */}
+
+
+
+ );
+}
diff --git a/src/app/(main)/biography/page.tsx b/src/app/(main)/biography/page.tsx
deleted file mode 100644
index e69de29..0000000
diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx
index 22a31e6..876f694 100644
--- a/src/app/(main)/layout.tsx
+++ b/src/app/(main)/layout.tsx
@@ -52,29 +52,6 @@ export default function MainLayout({
return (
-
-
-
-
-
-
-
-
diff --git a/src/components/HeaderNav.tsx b/src/components/HeaderNav.tsx
index aaea62d..961fac9 100644
--- a/src/components/HeaderNav.tsx
+++ b/src/components/HeaderNav.tsx
@@ -4,7 +4,6 @@ import addScrollspy from "@/utils/addScroll";
import { init_classic_menu_resize } from "@/utils/menuToggle";
import { scrollToElement } from "@/utils/scrollToElement";
import { closeMobileMenu, toggleMobileMenu } from "@/utils/toggleMobileMenu";
-import { usePathname } from "next/navigation";
import { useEffect, useRef, useState } from "react";
import Link from "next/link";
@@ -33,7 +32,6 @@ export default function HeaderNav({ links, animateY = false }: any) {
window.removeEventListener("resize", init_classic_menu_resize);
};
}, []);
- const pathname = usePathname();
return (
<>
diff --git a/src/components/Homepage.tsx b/src/components/Homepage.tsx
index 618f533..4b64426 100644
--- a/src/components/Homepage.tsx
+++ b/src/components/Homepage.tsx
@@ -160,10 +160,10 @@ export default function homepage({ onePage = false, dark = false }) {
- Explore Our Services
+ Explore Radixact®
- Explore Our Services
+ Explore Radixact®
diff --git a/src/components/SplashScreen.tsx b/src/components/SplashScreen.tsx
index 53be7ce..e69de29 100644
--- a/src/components/SplashScreen.tsx
+++ b/src/components/SplashScreen.tsx
@@ -1,52 +0,0 @@
-import React, { useEffect, useState } from "react";
-import Image from "next/image";
-import anime from "animejs";
-
-interface SplashScreenProps {
- finishLoading: () => void;
-}
-
-const SplashScreen: React.FC
= ({ finishLoading }) => {
- const [isMounted, setIsMounted] = useState(false);
-
- const animate = () => {
- const loader = anime.timeline({
- complete: () => finishLoading(),
- });
-
- loader
- .add({
- targets: "#logo",
- delay: 0,
- scale: 1,
- duration: 500,
- easing: "easeInOutExpo",
- })
- .add({
- targets: "#logo",
- delay: 0,
- scale: 1.25,
- duration: 500,
- easing: "easeInOutExpo",
- });
- };
-
- useEffect(() => {
- const timeout = setTimeout(() => {
- setIsMounted(true);
- }, 10);
-
- animate();
- return () => clearTimeout(timeout);
- }, []);
-
- return isMounted ? (
-
-
-
- ) : (
- <>>
- );
-};
-
-export default SplashScreen;
diff --git a/src/services/payload/team.ts b/src/services/payload/team.ts
new file mode 100644
index 0000000..e5dd882
--- /dev/null
+++ b/src/services/payload/team.ts
@@ -0,0 +1,27 @@
+import payloadConfig from "@/payload.config";
+import { formatDate } from "@/utils/datetime";
+import { getPayload } from "payload";
+
+export async function fetchTeamDetail(name: string | undefined) {
+ const payload = await getPayload({ config: payloadConfig });
+ const blogDataQuery = await payload.find({
+ collection: "teams",
+ where: {
+ name: { like: `%${name}%` },
+ },
+ limit: 1,
+ pagination: false,
+ });
+
+ if (!blogDataQuery?.docs?.[0]) return null;
+
+ const data = blogDataQuery?.docs?.[0];
+ const createdAt = formatDate(data.createdAt);
+ const imgUrl = typeof data.img !== "number" ? (data?.img?.url ?? "") : "";
+
+ return {
+ data,
+ createdAt,
+ imgUrl,
+ };
+}