1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-02-24 11:33:09 +01:00
developer-roadmap/components/page-header.tsx

39 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-10-05 07:55:44 +02:00
import { Badge, Box, Container, Heading, Link, Text } from '@chakra-ui/react';
2021-08-16 18:15:54 +02:00
import React from 'react';
2021-10-05 07:55:44 +02:00
import siteConfig from '../content/site.json';
2021-08-15 16:07:05 +02:00
type PageHeaderProps = {
title: string;
subtitle: string;
2021-08-16 18:15:54 +02:00
children?: React.ReactNode;
2021-10-05 07:55:44 +02:00
beforeTitle?: React.ReactNode;
2021-08-15 16:07:05 +02:00
};
export function PageHeader(props: PageHeaderProps) {
2021-10-05 07:55:44 +02:00
const { title, subtitle, children, beforeTitle = null } = props;
2021-08-15 16:07:05 +02:00
return (
2021-09-03 10:52:43 +02:00
<Box pt={['25px', '20px', '45px']} pb={['20px', '15px', '30px']} borderBottomWidth={1} mb='30px'>
2021-08-15 16:07:05 +02:00
<Container maxW='container.md' position='relative'>
2021-10-05 07:55:44 +02:00
{beforeTitle}
2021-08-28 13:50:44 +02:00
<Heading
as='h1'
color='black'
2021-09-09 22:32:12 +02:00
fontSize={['28px', '33px', '40px']}
2021-08-28 13:50:44 +02:00
fontWeight={700}
mb={['2px', '2px', '5px']}
>
{title}
</Heading>
2021-09-09 22:32:12 +02:00
<Text fontSize={['13px', '14px', '15px']}>{subtitle}</Text>
2021-08-15 16:07:05 +02:00
</Container>
2021-08-16 18:15:54 +02:00
{children && (
<Container maxW='container.md'>
{children}
</Container>
)}
2021-08-15 16:07:05 +02:00
</Box>
);
}