use serverside props for index

This commit is contained in:
2024-12-18 14:59:43 -06:00
parent 255b7067f3
commit 03cf3439e7

View File

@@ -13,12 +13,12 @@ import type { Project } from "../utils/types";
type ProjectWithBlur = Project & { bannerBlur: string }; type ProjectWithBlur = Project & { bannerBlur: string };
type HomeStaticProps = { type Props = {
tagline: string; tagline: string;
projects: ProjectWithBlur[]; projects: ProjectWithBlur[];
}; };
export async function getStaticProps() { export async function getServerSideProps(): Promise<{ props: Props }> {
const metadata = await directus.request(readSingleton("metadata")); const metadata = await directus.request(readSingleton("metadata"));
const projects: Project[] = [ const projects: Project[] = [
@@ -118,10 +118,7 @@ const buttons = [
{ text: "Resume", href: "/resume" }, { text: "Resume", href: "/resume" },
]; ];
const Home: NextPage<HomeStaticProps> = ({ const Home: NextPage<Props> = ({ tagline, projects }: Props) => {
tagline,
projects,
}: HomeStaticProps) => {
const useLong = useBreakpointValue("sm", true, false); const useLong = useBreakpointValue("sm", true, false);
// use-tailwind-breakpoint // use-tailwind-breakpoint