Files
developer-roadmap/components/roadmap/roadmap-page-header.tsx

114 lines
2.9 KiB
TypeScript
Raw Permalink Normal View History

import { isInteractiveRoadmap, RoadmapType } from '../../lib/roadmap';
2021-12-03 19:58:25 +01:00
import { NewAlertBanner } from './new-alert-banner';
2021-12-07 13:10:17 +01:00
import {
Badge,
2021-12-07 13:10:17 +01:00
Box,
Button,
Container,
2021-12-08 13:47:51 +01:00
Flex,
2021-12-07 13:10:17 +01:00
Heading,
Link,
Stack,
Text,
} from '@chakra-ui/react';
2021-12-03 19:58:25 +01:00
import { AtSignIcon, DownloadIcon } from '@chakra-ui/icons';
import React from 'react';
type RoadmapPageHeaderType = {
roadmap: RoadmapType;
2021-12-07 13:10:17 +01:00
};
2021-12-03 19:58:25 +01:00
export function RoadmapPageHeader(props: RoadmapPageHeaderType) {
const { roadmap } = props;
return (
2021-12-07 13:10:17 +01:00
<Box
pt={['25px', '20px', '45px']}
pb={['20px', '15px', '30px']}
borderBottomWidth={1}
mb="30px"
2021-12-03 19:58:25 +01:00
>
2021-12-07 13:10:17 +01:00
<Container maxW="container.md" position="relative">
<NewAlertBanner />
<Heading
as="h1"
color="black"
fontSize={['28px', '33px', '40px']}
fontWeight={700}
mb={['2px', '2px', '5px']}
>
{roadmap.title}
</Heading>
<Text fontSize={['13px', '14px', '15px']}>{roadmap.description}</Text>
2021-12-08 13:47:51 +01:00
<Flex justifyContent="space-between" alignItems={'center'} mt="20px">
<Stack isInline>
<Button
d={['flex', 'flex']}
as={Link}
href={'/roadmaps'}
size="xs"
py="14px"
px="10px"
colorScheme="teal"
variant="solid"
_hover={{ textDecoration: 'none' }}
>
&larr;
<Text as="span" d={['none', 'inline']} ml="5px">
All Roadmaps
</Text>
</Button>
2021-12-03 19:58:25 +01:00
2021-12-08 13:47:51 +01:00
{roadmap.pdfUrl && (
<Button
as={Link}
href={roadmap.pdfUrl}
target="_blank"
size="xs"
py="14px"
px="10px"
leftIcon={<DownloadIcon />}
colorScheme="yellow"
variant="solid"
_hover={{ textDecoration: 'none' }}
>
Download
</Button>
)}
2021-12-07 13:10:17 +01:00
<Button
as={Link}
2021-12-08 13:47:51 +01:00
href={'/signup'}
2021-12-07 13:10:17 +01:00
size="xs"
py="14px"
px="10px"
2021-12-08 13:47:51 +01:00
variant="solid"
2021-12-07 13:10:17 +01:00
colorScheme="yellow"
2021-12-08 13:47:51 +01:00
leftIcon={<AtSignIcon />}
_hover={{ textDecoration: 'none' }}
>
Subscribe
</Button>
</Stack>
</Flex>
{isInteractiveRoadmap(roadmap.id) && (
<Text
mt="30px"
2021-12-08 16:22:21 +01:00
mb={['-37px', '-32px', '-47px']}
fontWeight={500}
fontSize="14px"
bg="white"
borderWidth={1}
p="5px 7px"
rounded="3px"
>
<Badge pos="relative" top={'-1px'} mr="6px" colorScheme="yellow">
New
</Badge>
Resources are here, try clicking any nodes.
</Text>
)}
2021-12-07 13:10:17 +01:00
</Container>
</Box>
2021-12-03 19:58:25 +01:00
);
}