From 72ae78ede70cfaa4eb0bb794540f712c3a66ca83 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 29 Aug 2022 18:48:57 +0400 Subject: [PATCH] Add new badge to new roadmaps --- components/home/featured-roadmaps-list.tsx | 1 + components/roadmap/home-roadmap-item.tsx | 54 ++++++++++++---------- content/roadmaps.json | 4 ++ content/roadmaps/105-vue/meta.json | 1 + content/roadmaps/106-javascript/meta.json | 1 + content/roadmaps/107-nodejs/meta.json | 3 +- content/roadmaps/112-blockchain/meta.json | 1 + lib/roadmap.ts | 1 + public/sitemap.xml | 10 ++-- 9 files changed, 46 insertions(+), 30 deletions(-) diff --git a/components/home/featured-roadmaps-list.tsx b/components/home/featured-roadmaps-list.tsx index 97e8ad369..f15291e5a 100644 --- a/components/home/featured-roadmaps-list.tsx +++ b/components/home/featured-roadmaps-list.tsx @@ -23,6 +23,7 @@ export function FeaturedRoadmapsList(props: FeaturedRoadmapsListProps) { colorIndex={counter} title={roadmap.featuredTitle} isCommunity={roadmap.isCommunity} + isNew={roadmap.isNew} subtitle={roadmap.featuredDescription} /> ))} diff --git a/components/roadmap/home-roadmap-item.tsx b/components/roadmap/home-roadmap-item.tsx index bed4a6c9a..62dcd6d01 100644 --- a/components/roadmap/home-roadmap-item.tsx +++ b/components/roadmap/home-roadmap-item.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Heading, Link, Text, Tooltip } from '@chakra-ui/react'; +import { Badge, Box, Flex, Heading, Link, Text, Tooltip } from '@chakra-ui/react'; import { InfoIcon } from '@chakra-ui/icons'; type RoadmapGridItemProps = { @@ -7,6 +7,7 @@ type RoadmapGridItemProps = { isCommunity?: boolean; isUpcoming?: boolean; colorIndex?: number; + isNew?: boolean; url: string; }; @@ -21,7 +22,7 @@ const bgColorList = [ 'teal.200', 'yellow.100', 'green.200', - 'red.200', + 'red.200' ]; export function HomeRoadmapItem(props: RoadmapGridItemProps) { @@ -29,9 +30,10 @@ export function HomeRoadmapItem(props: RoadmapGridItemProps) { title, subtitle, isCommunity, + isNew, colorIndex = 0, url, - isUpcoming, + isUpcoming } = props; return ( @@ -40,66 +42,70 @@ export function HomeRoadmapItem(props: RoadmapGridItemProps) { href={url} _hover={{ textDecoration: 'none', - bg: 'rgba(255,255,255,.10)', + bg: 'rgba(255,255,255,.10)' }} sx={{ // On mobile devices, don't change the scale '@media (hover: none)': { '&:hover': { - bg: 'rgba(255,255,255,.05)', - }, - }, + bg: 'rgba(255,255,255,.05)' + } + } }} flex={1} - shadow="2xl" + shadow='2xl' className={'home-roadmap-item'} bg={'rgba(255,255,255,.05)'} - color="white" - p="15px" - rounded="10px" - pos="relative" + color='white' + p='15px' + rounded='10px' + pos='relative' > {isCommunity && ( - - + + )} {title} + + { isNew && New } - + {subtitle} {isUpcoming && ( Upcoming https://roadmap.sh/vue monthly - 2022-08-08T16:43:49.818Z + 2022-08-29T14:35:47.707Z 1.0 https://roadmap.sh/javascript monthly - 2022-08-17T22:44:44.573Z + 2022-08-29T14:35:15.626Z 1.0 @@ -51,7 +51,7 @@ https://roadmap.sh/nodejs monthly - 2022-08-25T19:14:40.904Z + 2022-08-29T14:35:29.504Z 1.0 @@ -81,7 +81,7 @@ https://roadmap.sh/blockchain monthly - 2022-08-16T00:30:54.157Z + 2022-08-29T14:36:56.532Z 1.0 @@ -273,7 +273,7 @@ https://roadmap.sh/ monthly - 2022-08-25T16:14:15.485Z + 2022-08-29T13:51:41.632Z 1.0