perf: image

This commit is contained in:
archer
2023-06-15 20:06:56 +08:00
parent bb36e637e0
commit 4cbe4ebdc3
7 changed files with 54 additions and 21 deletions

View File

@@ -1,17 +1,24 @@
import React, { memo } from 'react';
import { Box } from '@chakra-ui/react';
const Loading = () => {
const Loading = ({ text }: { text?: string }) => {
return (
<Box
minW={'100px'}
w={'100%'}
h={'80px'}
backgroundImage={'url("/imgs/loading.gif")'}
backgroundSize={'contain'}
backgroundRepeat={'no-repeat'}
backgroundPosition={'center'}
/>
<Box>
<Box
minW={'100px'}
w={'100%'}
h={'80px'}
backgroundImage={'url("/imgs/loading.gif")'}
backgroundSize={'contain'}
backgroundRepeat={'no-repeat'}
backgroundPosition={'center'}
/>
{text && (
<Box mt={1} textAlign={'center'} fontSize={'sm'} color={'myGray.600'}>
{text}
</Box>
)}
</Box>
);
};