portfolio/components/layouts/SimpleLayout.tsx

59 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-02-18 21:15:14 +00:00
import React, {ReactNode} from 'react'
import {Container} from '@/components/common/Container'
2023-02-18 22:37:09 +00:00
import {twMerge} from 'tailwind-merge'
2025-02-18 21:15:14 +00:00
import {SocialLink} from '@/components/ui/SocialLink'
import {GitHubIcon, LinkedInIcon} from '@/components/icons/SocialIcons'
2022-12-06 12:54:34 +00:00
2023-07-29 22:40:36 +00:00
export type SimpleLayoutProps = {
heading: string
description: string
2023-01-14 23:18:52 +00:00
children: ReactNode
gradient: string
2025-02-18 21:15:14 +00:00
displaySocials?: boolean
2023-01-14 23:18:52 +00:00
}
2023-01-14 19:31:05 +00:00
export function SimpleLayout({
2023-07-29 22:40:36 +00:00
heading,
description,
2023-01-14 19:31:05 +00:00
children,
2025-02-18 21:15:14 +00:00
gradient,
displaySocials = false
2023-07-29 22:40:36 +00:00
}: SimpleLayoutProps) {
2022-12-06 12:54:34 +00:00
return (
2025-02-19 20:46:05 +00:00
<Container className="mt-36">
2022-12-06 12:54:34 +00:00
<header className="max-w-2xl">
<h1
2023-02-18 22:37:09 +00:00
className={twMerge(`
text-4xl
font-bold
tracking-tight
text-zinc-800
dark:text-zinc-100
sm:text-5xl
${gradient ? `${gradient} bg-clip-text dark:text-transparent` : ''}
`)}>
2023-07-29 22:40:36 +00:00
{heading}
2022-12-06 12:54:34 +00:00
</h1>
<p className="mt-6 text-base text-zinc-600 dark:text-zinc-400">
2023-07-29 22:40:36 +00:00
{description}
2022-12-06 12:54:34 +00:00
</p>
2025-02-18 21:15:14 +00:00
{displaySocials &&
<div className="mt-6 flex gap-6">
<SocialLink
href="https://github.com/r-freeman"
ariaLabel="Follow on GitHub"
icon={GitHubIcon}
/>
<SocialLink
href="https://linkedin.com/in/r-freeman/"
ariaLabel="Follow on LinkedIn"
icon={LinkedInIcon}
/>
</div>
}
2022-12-06 12:54:34 +00:00
</header>
<div className="mt-16 sm:mt-20">{children}</div>
</Container>
)
}