From c74093c6e9be8022407193d351a3edcd045e55bb Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:00:06 +0300 Subject: [PATCH] Fix types Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- apps/roboshield/src/lib/data/index.ts | 6 ++++++ apps/roboshield/src/pages/about.tsx | 11 +++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/roboshield/src/lib/data/index.ts b/apps/roboshield/src/lib/data/index.ts index d299fa14b..6c0d33040 100644 --- a/apps/roboshield/src/lib/data/index.ts +++ b/apps/roboshield/src/lib/data/index.ts @@ -1 +1,7 @@ +import { Page } from "@/root/payload-types"; + export { getPageServerSideProps } from "./local"; + +export interface PageProps { + blocks: Page["blocks"]; +} diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx index e1c2ec1e7..7f2f62036 100644 --- a/apps/roboshield/src/pages/about.tsx +++ b/apps/roboshield/src/pages/about.tsx @@ -1,12 +1,7 @@ import { getPageServerSideProps } from "@/roboshield/lib/data"; import BlockRenderer from "@/roboshield/components/BlockRenderer"; -import { Page } from "@/root/payload-types"; - -type BlockType = Page["blocks"]; - -interface PageProps { - blocks: BlockType; -} +import { PageProps } from "@/roboshield/lib/data"; +import { GetServerSidePropsContext } from "next"; export default function About({ blocks }: PageProps) { return ( @@ -16,7 +11,7 @@ export default function About({ blocks }: PageProps) { ); } -export async function getServerSideProps(context: any) { +export async function getServerSideProps(context: GetServerSidePropsContext) { const { props } = await getPageServerSideProps(context); return { props: {