Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4296 | Rev 4299 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4298 stevensc 1
/* eslint-disable react/prop-types */
4296 stevensc 2
import React, { useState } from 'react'
3
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
4
import ExpandLessIcon from '@mui/icons-material/ExpandLess'
5
import StatItem from './StatItem'
6
import './Sidebar.css'
7
import RecentItem from './RecentItem'
4298 stevensc 8
import Avatar from '../../../../shared/Avatar/Avatar'
4296 stevensc 9
 
4298 stevensc 10
const Sidebar = ({
11
  image,
12
  fullName,
13
  description,
14
  visits,
15
  country,
16
  connections,
17
}) => {
4296 stevensc 18
  const [display, setDisplay] = useState(false)
19
 
20
  return (
21
    <div className='sidebar'>
22
 
23
      <div className='sidebar__top'>
24
        <img src='./static/profile_2.jpg' alt='Profile cover' />
4298 stevensc 25
        <Avatar imageUrl={image} size='xl' name={fullName} />
26
        <h2>{fullName}</h2>
27
        <h4>{description}</h4>
4296 stevensc 28
      </div>
29
 
30
      <div className={`sidebar__options ${display && 'show'}`}>
31
        <div className='sidebar__stats'>
4298 stevensc 32
          <StatItem title='¿Quien ha visto tu perfil?' number={visits} />
33
          <StatItem title='Conexiones' number={connections} />
4296 stevensc 34
        </div>
35
 
36
      </div>
37
 
38
      <footer className='sideabar__footer'>
39
        <button
40
          onClick={() => setDisplay(!display)}
41
          type='button'
42
        >
43
          <span>
44
            {display ? 'Show less' : 'Show more'}
45
          </span>
46
          {display ? <ExpandLessIcon /> : <ExpandMoreIcon />}
47
        </button>
48
      </footer>
49
 
50
    </div>
51
  )
52
}
53
 
54
export default Sidebar