diff --git a/components/links-list-item.tsx b/components/links-list-item.tsx new file mode 100644 index 000000000..14e7b117d --- /dev/null +++ b/components/links-list-item.tsx @@ -0,0 +1,40 @@ +import React from 'react'; +import { Badge, Flex, Link, Text } from '@chakra-ui/react'; + +type LinksListItemProps = { + title: string; + subtitle: string; + badgeText?: string; + icon?: React.ReactChild +}; + +export function LinksListItem(props: LinksListItemProps) { + const { title, subtitle, badgeText, icon } = props; + + return ( + + + {icon} + {title} + {badgeText && + {badgeText}} + + {subtitle} + + ); +} diff --git a/components/links-list.tsx b/components/links-list.tsx new file mode 100644 index 000000000..6bc778e48 --- /dev/null +++ b/components/links-list.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { StackDivider, VStack } from '@chakra-ui/react'; + +type LinksListProps = { + children: React.ReactChild[] +}; + +export function LinksList(props: LinksListProps) { + const { children } = props; + + return ( + } + spacing={0} + align='stretch' + > + {children} + + ); +} diff --git a/components/opensource-banner.tsx b/components/opensource-banner.tsx index f1deec4e3..a78743358 100644 --- a/components/opensource-banner.tsx +++ b/components/opensource-banner.tsx @@ -2,7 +2,7 @@ import { Box, Container, Heading, Link, Text } from '@chakra-ui/react'; export function OpensourceBanner() { return ( - + Open Source The project is OpenSource,  diff --git a/pages/guides/components/guide-list-item.tsx b/pages/guides/components/guide-list-item.tsx deleted file mode 100644 index 17ba1a518..000000000 --- a/pages/guides/components/guide-list-item.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Badge, Flex, Link, Text } from '@chakra-ui/react'; - -type GuideListItemProps = { - title: string; - date: string; - isPro?: boolean; -}; - -export function GuideListItem(props: GuideListItemProps) { - const { title, date, isPro = false } = props; - - return ( - - - - {title} - {isPro && Pro} - - {date} - - ); -} diff --git a/pages/index.tsx b/pages/index.tsx index 4da190861..8b9c8da17 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,13 +1,13 @@ -import { Box, Container, Heading, Link, SimpleGrid, StackDivider, Text, Tooltip, VStack } from '@chakra-ui/react'; -import { InfoIcon } from '@chakra-ui/icons'; +import { Box, Container, Heading, Link, SimpleGrid, Text } from '@chakra-ui/react'; import { Header } from '../components/header'; import { Footer } from '../components/footer'; import { UpdatesBanner } from '../components/updates-banner'; import { OpensourceBanner } from '../components/opensource-banner'; -import { GuideListItem } from './guides/components/guide-list-item'; import { DimmedMore } from '../components/dimmed-more'; -import { VideoListItem } from './watch/components/video-list-item'; import { RoadmapGridItem } from './roadmaps/components/roadmap-grid-item'; +import { LinksListItem } from '../components/links-list-item'; +import { VideoIcon } from '../icons/video-icon'; +import { LinksList } from '../components/links-list'; export default function Home() { return ( @@ -28,12 +28,18 @@ export default function Home() { guides which we hope you are going to love. - - - - - - + + + + + + @@ -44,24 +50,20 @@ export default function Home() { Visual Guides - } - spacing={0} - align='stretch' - > - - - - - - - - - + + + + + + + + + + + - + @@ -71,24 +73,30 @@ export default function Home() { Video Explanations - } - spacing={0} - align='stretch' - > - - - - - - - - - + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> - + diff --git a/pages/watch/components/video-list-item.tsx b/pages/watch/components/video-list-item.tsx deleted file mode 100644 index 906650b7e..000000000 --- a/pages/watch/components/video-list-item.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Badge, Flex, Link, Text } from '@chakra-ui/react'; -import { VideoIcon } from '../../../icons/video-icon'; - -type VideoListItemProps = { - title: string; - duration: string; - isPro?: boolean; -}; - -export function VideoListItem(props: VideoListItemProps) { - const { title, duration, isPro = false } = props; - - return ( - - - - {title} - {isPro && Pro} - - {duration} - - ); -}