parent
c8395aa3df
commit
41ec8327c4
6 changed files with 112 additions and 119 deletions
@ -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 ( |
||||
<Link |
||||
fontSize='15px' |
||||
py='9px' |
||||
d='flex' |
||||
fontWeight={500} |
||||
color='gray.600' |
||||
alignItems='center' |
||||
justifyContent={'space-between'} |
||||
_hover={{ |
||||
textDecoration: 'none', |
||||
color: 'blue.400', |
||||
'& .list-item-title': { |
||||
transform: 'translateX(10px)' |
||||
} |
||||
}} |
||||
> |
||||
<Flex alignItems='center' className='list-item-title' transition={'200ms'}> |
||||
{icon} |
||||
<Text as='span'>{title}</Text> |
||||
{badgeText && |
||||
<Badge pos='relative' top='1px' variant='subtle' colorScheme='purple' ml='10px'>{badgeText}</Badge>} |
||||
</Flex> |
||||
<Text as='span' fontSize='13px' color='gray.500'>{subtitle}</Text> |
||||
</Link> |
||||
); |
||||
} |
@ -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 ( |
||||
<VStack |
||||
rounded='5px' |
||||
divider={<StackDivider borderColor='gray.200' />} |
||||
spacing={0} |
||||
align='stretch' |
||||
> |
||||
{children} |
||||
</VStack> |
||||
); |
||||
} |
@ -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 ( |
||||
<Link |
||||
fontSize='15px' |
||||
px='0' |
||||
py='8px' |
||||
d='flex' |
||||
fontWeight={500} |
||||
color='gray.600' |
||||
alignItems='center' |
||||
justifyContent={'space-between'} |
||||
_hover={{ |
||||
textDecoration: 'none', |
||||
color: 'blue.400', |
||||
'& .guide-title': { |
||||
transform: 'translateX(10px)' |
||||
} |
||||
}} |
||||
> |
||||
|
||||
<Flex alignItems='center' className='guide-title' transition={'200ms'}> |
||||
<Text as='span' ml='7px'>{title}</Text> |
||||
{isPro && <Badge pos='relative' top='1px' variant='subtle' colorScheme='purple' ml='10px'>Pro</Badge>} |
||||
</Flex> |
||||
<Text fontSize='13px' color='gray.500' as='span'>{date}</Text> |
||||
</Link> |
||||
); |
||||
} |
@ -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 ( |
||||
<Link |
||||
fontSize='15px' |
||||
p='10px' |
||||
d='flex' |
||||
fontWeight={500} |
||||
color='gray.600' |
||||
alignItems='center' |
||||
justifyContent={'space-between'} |
||||
_hover={{ |
||||
textDecoration: 'none', |
||||
color: 'blue.400', |
||||
'& .video-title': { |
||||
transform: 'translateX(10px)' |
||||
} |
||||
}} |
||||
> |
||||
<Flex alignItems='center' className='video-title' transition={'200ms'}> |
||||
<VideoIcon style={{ width: '18px', height: '18px', color: '#9c9c9c' }} /> |
||||
<Text as='span' ml='7px'>{title}</Text> |
||||
{isPro && <Badge pos='relative' top='1px' variant='subtle' colorScheme='purple' ml='10px'>Pro</Badge>} |
||||
</Flex> |
||||
<Text as='span' fontWeight={500} color='gray.400' fontSize='12px' ml='10px'>{duration}</Text> |
||||
</Link> |
||||
); |
||||
} |
Loading…
Reference in new issue