mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-23 00:25:40 +00:00
Added types
This commit is contained in:
parent
28fbd0f6c2
commit
8e61c2d0e1
@ -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) {
|
||||||
|
@ -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">
|
||||||
|
Loading…
Reference in New Issue
Block a user