Added types

This commit is contained in:
r-freeman 2023-01-14 23:18:52 +00:00
parent 28fbd0f6c2
commit 8e61c2d0e1
2 changed files with 18 additions and 16 deletions

View File

@ -5,6 +5,15 @@ import {formatDate} from '@/lib/formatDate'
import {Prose} from './Prose'
import {ReactNode} from 'react'
type ArticleLayout = {
children?: ReactNode
isRssFeed: boolean
title: string
description: string
ogImage: string
date: string
}
export function ArticleLayout({
children,
isRssFeed = false,
@ -12,15 +21,7 @@ export function ArticleLayout({
description,
ogImage,
date
}:
{
children?: ReactNode,
isRssFeed: boolean,
title: string,
description: string,
ogImage: string,
date: string
}) {
}: ArticleLayout) {
const pathname = usePathname()
if (isRssFeed) {

View File

@ -2,18 +2,19 @@ import {ReactNode} from 'react'
import clsx from 'clsx'
import {Container} from './Container'
type SimpleLayout = {
title: string
intro: string
children: ReactNode
gradient: string
}
export function SimpleLayout({
title,
intro,
children,
gradient
}:
{
title: string,
intro: string,
children: ReactNode,
gradient: string
}) {
}: SimpleLayout) {
return (
<Container className="mt-16 sm:mt-32">
<header className="max-w-2xl">