feat: 首页提示

This commit is contained in:
Archer
2023-03-18 12:40:05 +08:00
parent 00b90f071d
commit 7ba14d2c14
3 changed files with 37 additions and 18 deletions

View File

@@ -107,6 +107,23 @@ const SlideBar = ({
</>
);
const RenderButton = ({ onClick, children }: { onClick: () => void; children: JSX.Element }) => (
<Box px={3} mb={3}>
<Flex
alignItems={'center'}
p={2}
cursor={'pointer'}
borderRadius={'md'}
_hover={{
backgroundColor: 'rgba(255,255,255,0.2)'
}}
onClick={onClick}
>
{children}
</Flex>
</Box>
);
return (
<Flex
flexDirection={'column'}
@@ -193,24 +210,24 @@ const SlideBar = ({
<Divider my={4} />
<Box px={3}>
<Flex
alignItems={'center'}
p={2}
cursor={'pointer'}
borderRadius={'md'}
_hover={{
backgroundColor: 'rgba(255,255,255,0.2)'
}}
onClick={() => {
onOpenShare();
onClose();
}}
>
<RenderButton onClick={() => router.push('/')}>
<>
<MyIcon name="home" fill={'white'} w={'18px'} h={'18px'} mr={4} />
</>
</RenderButton>
<RenderButton
onClick={() => {
onOpenShare();
onClose();
}}
>
<>
<MyIcon name="share" fill={'white'} w={'16px'} h={'16px'} mr={4} />
</Flex>
</Box>
</>
</RenderButton>
{/* 分享提示modal */}
<Modal isOpen={isOpenShare} onClose={onCloseShare}>