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

View File

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