Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2917 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2917 Rev 3596
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react';
2
import { useNavigate } from 'react-router-dom'
2
import { useNavigate } from 'react-router-dom';
3
import { Avatar, Button, styled, Typography } from '@mui/material'
3
import { Avatar, Button, styled, Typography } from '@mui/material';
4
import { useSelector } from 'react-redux'
4
import { useSelector } from 'react-redux';
5
import parse from 'html-react-parser'
5
import parse from 'html-react-parser';
Línea 6... Línea 6...
6
 
6
 
Línea 7... Línea 7...
7
import colors from '@styles/colors'
7
import colors from '@styles/config/colors';
Línea 8... Línea 8...
8
 
8
 
9
import Widget from '@components/UI/Widget'
9
import Widget from '@components/UI/Widget';
10
 
10
 
11
const WidgetButton = styled(Button)(() => ({
11
const WidgetButton = styled(Button)(() => ({
Línea 17... Línea 17...
17
  justifyContent: 'space-between',
17
  justifyContent: 'space-between',
18
  width: '100%',
18
  width: '100%',
19
  '& span': {
19
  '& span': {
20
    color: '#0a66c2'
20
    color: '#0a66c2'
21
  }
21
  }
22
}))
22
}));
Línea 23... Línea 23...
23
 
23
 
24
const UserProfileAvatar = styled(Avatar)(() => ({
24
const UserProfileAvatar = styled(Avatar)(() => ({
25
  width: '60px',
25
  width: '60px',
26
  height: '60px',
26
  height: '60px',
27
  margin: 'auto'
27
  margin: 'auto'
Línea 28... Línea 28...
28
}))
28
}));
29
 
-
 
30
const UserProfileCard = ({
-
 
31
  user: {
-
 
32
    cover = '',
-
 
33
    image = '',
29
 
34
    fullname = '',
-
 
35
    description = '',
-
 
36
    visits = 0,
-
 
37
    connections = 0
30
const UserProfileCard = ({
38
  }
31
  user: { cover = '', image = '', fullname = '', description = '', visits = 0, connections = 0 }
39
}) => {
32
}) => {
Línea 40... Línea 33...
40
  const labels = useSelector(({ intl }) => intl.labels)
33
  const labels = useSelector(({ intl }) => intl.labels);
Línea 41... Línea 34...
41
  const navigate = useNavigate()
34
  const navigate = useNavigate();
42
 
35
 
43
  const handleNavigate = (path) => navigate(path)
36
  const handleNavigate = (path) => navigate(path);
44
 
37
 
Línea 58... Línea 51...
58
        <UserProfileAvatar src={image} alt={`${fullname} profile image`} />
51
        <UserProfileAvatar src={image} alt={`${fullname} profile image`} />
59
        <Typography variant='h2'>{parse(fullname ?? '')}</Typography>
52
        <Typography variant='h2'>{parse(fullname ?? '')}</Typography>
60
        <Typography>{parse(description ?? '')}</Typography>
53
        <Typography>{parse(description ?? '')}</Typography>
61
      </Widget.Body>
54
      </Widget.Body>
Línea 62... Línea -...
62
 
-
 
63
      <WidgetButton
55
 
64
        onClick={() => handleNavigate('/profile/people-viewed-profile')}
-
 
65
      >
56
      <WidgetButton onClick={() => handleNavigate('/profile/people-viewed-profile')}>
66
        {labels.who_has_seen_my_profile}
57
        {labels.who_has_seen_my_profile}
67
        <Typography variant='overline'>{visits ?? 0}</Typography>
58
        <Typography variant='overline'>{visits ?? 0}</Typography>
Línea 68... Línea -...
68
      </WidgetButton>
-
 
69
 
59
      </WidgetButton>
70
      <WidgetButton
-
 
71
        onClick={() => handleNavigate('/connection/my-connections')}
60
 
72
      >
61
      <WidgetButton onClick={() => handleNavigate('/connection/my-connections')}>
73
        {labels.connections}
62
        {labels.connections}
74
        <Typography variant='overline'>{connections ?? 0}</Typography>
63
        <Typography variant='overline'>{connections ?? 0}</Typography>
75
      </WidgetButton>
64
      </WidgetButton>
76
    </Widget>
65
    </Widget>
Línea 77... Línea 66...
77
  )
66
  );