Files
developer-roadmap/pages/roadmaps/components/roadmap-grid-item.tsx

67 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-08-16 00:10:18 +02:00
import { Badge, Box, Heading, Link, Text } from '@chakra-ui/react';
2021-08-14 20:43:23 +02:00
type RoadmapGridItemProps = {
title: string;
subtitle: string;
2021-08-16 00:10:18 +02:00
date: string;
2021-08-14 20:43:23 +02:00
isCommunity?: boolean;
2021-08-16 00:10:18 +02:00
colorIndex?: number;
2021-08-14 20:43:23 +02:00
};
const bgColorList = [
2021-08-16 00:10:18 +02:00
'gray.900',
'purple.900',
2021-08-14 20:43:23 +02:00
'blue.900',
2021-08-16 00:10:18 +02:00
'red.900',
'green.900',
'teal.900',
'yellow.900',
'cyan.900',
'pink.900',
'gray.800',
'purple.800',
'blue.800',
2021-08-14 20:43:23 +02:00
'red.800',
'green.800',
'teal.800',
2021-08-16 00:10:18 +02:00
'yellow.800',
'cyan.800',
'pink.800',
'gray.700',
'purple.700',
'blue.700',
'red.700',
'green.700',
'teal.700',
'yellow.700',
'cyan.700',
'pink.700',
'gray.600',
'purple.600',
'blue.600',
'red.600',
'green.600',
'teal.600',
'yellow.600',
'cyan.600',
'pink.600'
2021-08-14 20:43:23 +02:00
];
export function RoadmapGridItem(props: RoadmapGridItemProps) {
2021-08-16 00:10:18 +02:00
const { title, subtitle, date, isCommunity = false, colorIndex = 0 } = props;
2021-08-14 20:43:23 +02:00
return (
2021-08-16 00:10:18 +02:00
<Link _hover={{ textDecoration: 'none', transform: 'scale(1.02)' }} as={Box} href='#' shadow='xl' p='20px'
rounded='10px' bg={bgColorList[colorIndex] ?? bgColorList[0]} flex={1}>
<Heading color='white' mb={'6px'} fontSize='20px'>{title}</Heading>
<Text color='gray.300' fontSize='14px'>{subtitle}</Text>
{isCommunity && <Text mt='10px' fontSize='13px' color='gray.400'>
<Badge colorScheme={'yellow'} mr='10px'>Community</Badge>
</Text>}
2021-08-14 20:43:23 +02:00
</Link>
);
}