File size: 3,009 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import React from 'react';
import {
   Box,
   Divider,
   HStack,
   Image,
   Text,
   useColorModeValue,
} from '@chakra-ui/react';
import { doc, commentLg, tag } from '../../assets/icons';

const ProfileLeftPart = ({
   publishedPosts,
   profileData,
   display,
   totalCommentWritten,
}) => {
   const cardBg = useColorModeValue(
      'light.cardSecondaryBg',
      'dark.cardSecondaryBg'
   );

   const cardColor = useColorModeValue(
      'light.cardSecondaryColor',
      'dark.cardSecondaryColor'
   );

   const ghostColor = useColorModeValue('light.ghostColor', 'dark.ghostColor');

   const TechStack = ({ title, text }) => {
      return (
         <Box
            bg={cardBg}
            color={cardColor}
            p={{ base: '1rem .5rem', md: '1rem' }}
            borderRadius='5px'
            mb={{ base: 1, md: 3 }}
            className='shadowSecondary'
         >
            <Text fontWeight={700} fontSize='18px' color={cardColor}>
               {title}
            </Text>
            <Divider mt={3} mb={5} />
            <Text color={ghostColor}>{text}</Text>
         </Box>
      );
   };

   const totalFollowingTags = profileData.followingTags?.length || 0;

   return (
      <Box
         m={{ base: '0 0 1rem 0', md: '0 1rem 0 0' }}
         flex={{ base: 'unset', md: '1' }}
         w={{ base: '100%' }}
         display={display}
      >
         {profileData.learning && (
            <TechStack title='Currently Learning' text={profileData.learning} />
         )}

         {profileData.skills && (
            <TechStack title='Skills/Languages' text={profileData.skills} />
         )}

         {profileData.hacking && (
            <TechStack
               title='Currently hacking on'
               text={profileData.hacking}
            />
         )}

         {profileData.avaliable && (
            <TechStack title='Available for' text={profileData.avaliable} />
         )}

         <Box
            className='shadowSecondary'
            bg={cardBg}
            color={cardColor}
            p={{ base: '1.5rem .5rem', md: '1.5rem 1rem' }}
            borderRadius='5px'
         >
            <HStack mb='.7rem'>
               <Image src={doc} alt='doc_icon' />
               <Text>
                  {publishedPosts} {publishedPosts > 1 ? 'posts' : 'post'}{' '}
                  published
               </Text>
            </HStack>

            <HStack mb='.7rem'>
               <Image src={commentLg} alt='comment_icon' />
               <Text>
                  {totalCommentWritten}{' '}
                  {totalCommentWritten > 1 ? 'comments' : 'comment'} written
               </Text>
            </HStack>

            <HStack>
               <Image src={tag} alt='tag_icon' />
               <Text>
                  {totalFollowingTags} {totalFollowingTags > 1 ? 'tags' : 'tag'}{' '}
                  followed
               </Text>
            </HStack>
         </Box>
      </Box>
   );
};

export default ProfileLeftPart;