fix: lint
This commit is contained in:
parent
3149e0671f
commit
8fd3b43cb4
96
src/app/(main)/biography/[slug]/page.tsx
Normal file
96
src/app/(main)/biography/[slug]/page.tsx
Normal file
@ -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 (
|
||||
<>
|
||||
<Suspense fallback={<Loading />}>
|
||||
<>
|
||||
<section className="page-section bg-dark-1 bg-gradient-gray-dark-1 light-content bg-scroll overflow-hidden">
|
||||
{/* <!-- Background Shape --> */}
|
||||
<div className="bg-shape-1 opacity-003">
|
||||
<Image src="/assets/images/demo-fancy/bg-shape-1.svg" width={1300} height={844} alt="" />
|
||||
</div>
|
||||
{/* <!-- End Background Shape --> */}
|
||||
|
||||
<div className="container position-relative pt-sm-40 text-center">
|
||||
<div className="row">
|
||||
<div className="col-md-10 offset-md-1 col-lg-8 offset-lg-2">
|
||||
<h1 className="hs-title-10 mb-10 wow fadeInUp">{data.data.name}</h1>
|
||||
{/* Author, Categories, Comments */}
|
||||
<div className="blog-item-data mb-0 wow fadeIn" data-wow-delay="0.2s">
|
||||
<div className="flex justify-center items-center">
|
||||
<i className="mi-clock mr-2" />
|
||||
<a href="#">{data.createdAt}</a>
|
||||
</div>
|
||||
</div>
|
||||
{/* End Author, Categories, Comments */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Section */}
|
||||
<section className="page-section">
|
||||
<div className="container relative">
|
||||
<div className="row">
|
||||
{/* Content */}
|
||||
<div className="col-md-10 offset-md-1 col-lg-8 offset-lg-2">
|
||||
{/* Post */}
|
||||
<div className="blog-item mb-80 mb-xs-40">
|
||||
<div className="blog-item-body">
|
||||
<div className="mb-40 mb-xs-30">
|
||||
<Image src={data.imgUrl} alt={data.data.name} width={300} height={500} className="round" />
|
||||
</div>
|
||||
<div>
|
||||
<RichText data={data.data.biography as any} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* End Post */}
|
||||
</div>
|
||||
{/* End Content */}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{/* End Section */}
|
||||
</>
|
||||
<BeforeFooterBlock />
|
||||
</Suspense>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function Loading() {
|
||||
return (
|
||||
<section className="page-section animate-pulse">
|
||||
<div className="container relative">
|
||||
<div className="row">
|
||||
{/* Content */}
|
||||
<div className="col-md-10 offset-md-1 col-lg-8 offset-lg-2">
|
||||
{/* Post */}
|
||||
<div className="blog-item mb-80 mb-xs-40">
|
||||
<div className="blog-item-body">
|
||||
<div className="mb-40 mb-xs-30">
|
||||
<div className="w-full h-72 bg-gray-300 rounded-lg"></div>
|
||||
<div className="h-5 bg-gray-300 rounded w-full mt-3"></div>
|
||||
<div className="h-5 bg-gray-300 rounded w-3/4 mt-3"></div>
|
||||
<div className="h-5 bg-gray-300 rounded w-2/3 mt-3"></div>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
{/* End Post */}
|
||||
</div>
|
||||
{/* End Content */}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
@ -52,29 +52,6 @@ export default function MainLayout({
|
||||
|
||||
return (
|
||||
<html lang="en" className="no-mobile no-touch">
|
||||
<head>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap" rel="stylesheet" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;1,400;1,500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500&family=Poppins&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
<body className="appear-animate body">
|
||||
<div className="theme-slick">
|
||||
<div className="page" id="top">
|
||||
|
@ -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 (
|
||||
<>
|
||||
|
@ -160,10 +160,10 @@ export default function homepage({ onePage = false, dark = false }) {
|
||||
|
||||
<Link href={`/radixact`} className="link-hover-anim underline align-middle" data-link-animate="y">
|
||||
<span className="link-strong link-strong-unhovered">
|
||||
Explore Our Services <i className="mi-arrow-right size-18" aria-hidden="true"></i>
|
||||
Explore Radixact® <i className="mi-arrow-right size-18" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span className="link-strong link-strong-hovered" aria-hidden="true">
|
||||
Explore Our Services <i className="mi-arrow-right size-18" aria-hidden="true"></i>
|
||||
Explore Radixact® <i className="mi-arrow-right size-18" aria-hidden="true"></i>
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
@ -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<SplashScreenProps> = ({ 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 ? (
|
||||
<div className="flex h-screen items-center justify-center">
|
||||
<Image id="logo" src={"/assets/images/demo-slick/logo-dark.webp"} alt="" width={500} height={500} />
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
);
|
||||
};
|
||||
|
||||
export default SplashScreen;
|
27
src/services/payload/team.ts
Normal file
27
src/services/payload/team.ts
Normal file
@ -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,
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user