mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-16 00:13:50 -06:00
use serverside props for index
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user