File size: 1,936 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import {
   Box,
   HStack,
   Skeleton,
   SkeletonCircle,
   SkeletonText,
} from '@chakra-ui/react';
import React from 'react';
import useSkeletonColor from '../../hooks/useSkeletonColor';

const PostItemSkeleton = ({ firstItem }) => {
   const skeletonColor = useSkeletonColor();

   return (
      <Box
         bg='transparent'
         px={['.5rem', '1.5rem']}
         py={['.7rem', '1.5rem']}
         borderRadius={{ base: '0', md: '5px' }}
         mb='.5rem'
         mx='auto'
         className='shadow'
      >
         {firstItem && (
            <Box h={{ base: '200px', md: '230px' }} mb='.5rem'></Box>
         )}

         <HStack>
            <SkeletonCircle size='10' {...skeletonColor} />
            <SkeletonText
               mt={3}
               noOfLines={2}
               spacing='2'
               w='30%'
               {...skeletonColor}
            />
         </HStack>

         <Box ms={{ base: '0', md: '48px' }}>
            <Skeleton h='15px' mt={2} {...skeletonColor} />

            <Skeleton h='15px' w='50%' mt={2} {...skeletonColor} />

            <HStack justify='space-between' mt={2}>
               <HStack>
                  <HStack>
                     <Skeleton
                        w={['50px', '90px']}
                        h='15px'
                        {...skeletonColor}
                     />
                  </HStack>
                  <HStack>
                     <Skeleton
                        w={['50px', '90px']}
                        h='15px'
                        {...skeletonColor}
                     />
                  </HStack>
               </HStack>

               <HStack>
                  <SkeletonText noOfLines={1} w='70px' {...skeletonColor} />
                  <Skeleton w='20px' h='20px' {...skeletonColor} />
               </HStack>
            </HStack>
         </Box>
      </Box>
   );
};

export default PostItemSkeleton;