Skip to content

Commit

Permalink
refactor: add type PostPageProps
Browse files Browse the repository at this point in the history
  • Loading branch information
donBarbos committed Jul 30, 2023
1 parent 9c599ae commit 6f1036c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const sourceCodePro = Source_Code_Pro({

const APP_URL = process.env.APP_URL || 'http://localhost:3000'

export type PostPageProps = {
page: IPage
}

export const getServerSideProps: GetServerSideProps = async (context) => {
context.res.setHeader('Cache-Control', 'public, max-age=31536000, must-revalidate')
const { slug } = context.query
Expand All @@ -34,11 +38,11 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
return {
props: {
page,
},
} as PostPageProps,
}
}

export default function PostPage({ page }: { page: IPage }) {
export default function PostPage({ page }: PostPageProps) {
const text = page.text
const title = page.title || 'note'
// const description = page.text[]
Expand Down

0 comments on commit 6f1036c

Please sign in to comment.