Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4307 | Rev 4309 | 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'
4299 stevensc 5
import parse from 'html-react-parser'
6
import Avatar from '../../../../shared/Avatar/Avatar'
4296 stevensc 7
import StatItem from './StatItem'
8
import RecentItem from './RecentItem'
4299 stevensc 9
import './Sidebar.scss'
4296 stevensc 10
 
4298 stevensc 11
const Sidebar = ({
12
  image,
13
  fullName,
14
  description,
15
  visits,
16
  country,
17
  connections,
18
}) => {
4296 stevensc 19
  const [display, setDisplay] = useState(false)
20
 
21
  return (
22
    <div className='sidebar'>
23
 
24
      <div className='sidebar__top'>
4301 stevensc 25
        <img src='./static/profile_2.jpg' alt='Profile cover' className='sidebar__cover' />
4298 stevensc 26
        <Avatar imageUrl={image} size='xl' name={fullName} />
4299 stevensc 27
        <h2>{parse(fullName)}</h2>
4301 stevensc 28
        {parse(description)}
4296 stevensc 29
      </div>
30
 
31
      <div className={`sidebar__options ${display && 'show'}`}>
32
        <div className='sidebar__stats'>
4307 stevensc 33
          <StatItem title='¿Quien ha visto tu perfil?' number={visits} url='/profile/people-viewed-profile' />
4308 stevensc 34
          <StatItem title='Conexiones' number={connections} url='/connection/my-connections' />
4296 stevensc 35
        </div>
36
 
37
      </div>
38
 
39
      <footer className='sideabar__footer'>
40
        <button
41
          onClick={() => setDisplay(!display)}
42
          type='button'
43
        >
44
          <span>
45
            {display ? 'Show less' : 'Show more'}
46
          </span>
47
          {display ? <ExpandLessIcon /> : <ExpandMoreIcon />}
48
        </button>
49
      </footer>
50
 
51
    </div>
52
  )
53
}
54
 
55
export default Sidebar