Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 517 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 517 Rev 856
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
-
 
2
import { Link } from 'react-router-dom'
2
import { Avatar } from '@mui/material'
3
import { Avatar } from '@mui/material'
3
import { useSelector } from 'react-redux'
4
import { useSelector } from 'react-redux'
-
 
5
 
4
import parse from 'html-react-parser'
6
import Paraphrase from '../../UI/Paraphrase'
5
import { Link } from 'react-router-dom'
7
import StyledContainer from '../../widgets/WidgetLayout'
Línea 6... Línea 8...
6
 
8
 
7
const UserInfo = ({
9
const UserInfo = ({
8
  cover = '',
10
  cover = '',
9
  image = '',
11
  image = '',
10
  fullname = '',
12
  fullname = '',
11
  description = '',
13
  description = '',
12
  visits = 0,
14
  visits = 0,
13
  connections = 0,
15
  connections = 0
14
}) => {
16
}) => {
-
 
17
  const labels = useSelector(({ intl }) => intl.labels)
15
  const labels = useSelector(({ intl }) => intl.labels)
18
 
16
  return (
19
  return (
17
    <div className="sidebar__top">
20
    <StyledContainer>
18
      {cover && (
21
      {cover && (
19
        <img
22
        <img
20
          src="./static/profile_2.jpg"
23
          src='./static/profile_2.jpg'
21
          alt="Profile cover"
24
          alt='Profile cover'
22
          className="sidebar__cover"
25
          className='sidebar__cover'
23
        />
26
        />
24
      )}
27
      )}
25
      <Avatar
28
      <Avatar
26
        src={image}
29
        src={image}
27
        alt={`${fullname} profile image`}
30
        alt={`${fullname} profile image`}
28
        sx={{ width: '60px', height: '60px' }}
31
        sx={{ width: '60px', height: '60px' }}
29
      />
32
      />
30
      <h2>{parse(fullname)}</h2>
33
      <Paraphrase as='h2'>{fullname}</Paraphrase>
31
      {parse(description)}
34
      <Paraphrase>{description}</Paraphrase>
32
      <StatItem
35
      <StatItem
33
        title={labels.who_has_seen_my_profile}
36
        title={labels.who_has_seen_my_profile}
34
        number={visits}
37
        number={visits}
35
        url="/profile/people-viewed-profile"
38
        url='/profile/people-viewed-profile'
36
      />
39
      />
37
      <StatItem
40
      <StatItem
38
        title={labels.connections}
41
        title={labels.connections}
39
        number={connections}
42
        number={connections}
40
        url="/connection/my-connections"
43
        url='/connection/my-connections'
41
      />
44
      />
42
    </div>
45
    </StyledContainer>
43
  )
46
  )
Línea 44... Línea 47...
44
}
47
}
45
 
48
 
46
const StatItem = ({ title = '', number = 0, url = '' }) => {
49
const StatItem = ({ title = '', number = 0, url = '' }) => {
47
  return (
50
  return (
48
    <Link
51
    <Link
49
      to={url}
52
      to={url}
50
      className="sidebar__stat"
53
      className='sidebar__stat'
51
      target="secondary"
54
      target='secondary'
52
      onClick={(e) => !url && e.preventDefault()}
55
      onClick={(e) => !url && e.preventDefault()}
53
    >
56
    >
54
      <span>{title}</span>
57
      <span>{title}</span>
55
      <span className="sidebar__stat-number">{number}</span>
58
      <span className='sidebar__stat-number'>{number}</span>
56
    </Link>
59
    </Link>
Línea 57... Línea 60...
57
  )
60
  )