Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4313 | Rev 4444 | 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'
4313 stevensc 8
import HelpersContainer from './HelpersContainer'
4299 stevensc 9
import './Sidebar.scss'
4438 stevensc 10
import SocialNetworks from '../../../components/home-section/SocialNetworks'
4296 stevensc 11
 
4298 stevensc 12
const Sidebar = ({
13
  image,
14
  fullName,
15
  description,
16
  visits,
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>
4313 stevensc 36
        <HelpersContainer />
4296 stevensc 37
      </div>
4438 stevensc 38
      <SocialNetworks className='sidebar-apps__widget'/>
4296 stevensc 39
 
40
      <footer className='sideabar__footer'>
41
        <button
42
          onClick={() => setDisplay(!display)}
43
          type='button'
44
        >
45
          <span>
46
            {display ? 'Show less' : 'Show more'}
47
          </span>
48
          {display ? <ExpandLessIcon /> : <ExpandMoreIcon />}
49
        </button>
50
      </footer>
51
 
52
    </div>
53
  )
54
}
55
 
56
export default Sidebar