Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2996 Rev 2997
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { useNavigate } from 'react-router-dom'
-
 
3
import { useDispatch } from 'react-redux'
-
 
4
import { Avatar, styled, Typography } from '@mui/material'
2
import { Avatar, styled, Typography } from '@mui/material'
5
import {
3
import {
6
  VisibilityOutlined,
4
  VisibilityOutlined,
7
  MapOutlined,
5
  MapOutlined,
8
  ShareOutlined
6
  ShareOutlined
9
} from '@mui/icons-material'
7
} from '@mui/icons-material'
Línea 10... Línea -...
10
 
-
 
11
import { axios } from '@utils'
-
 
12
import { addNotification } from '@store/notification/notification.actions'
-
 
13
 
8
 
14
import Widget from '@components/UI/Widget'
-
 
Línea 15... Línea 9...
15
import Options from '@components/UI/Option'
9
import Widget from '@components/UI/Widget'
16
 
10
 
17
const Row = styled('div')(() => ({
11
const Row = styled('div')(() => ({
18
  display: 'flex',
12
  display: 'flex',
Línea 23... Línea 17...
23
export default function ProfileInfo({
17
export default function ProfileInfo({
24
  image,
18
  image,
25
  fullName,
19
  fullName,
26
  visits,
20
  visits,
27
  country,
21
  country,
28
  connections,
22
  connections
29
  linkAdmin,
-
 
30
  linkImpersonate
-
 
31
}) {
23
}) {
32
  const navigate = useNavigate()
-
 
33
  const dispatch = useDispatch()
-
 
34
 
-
 
35
  const getAdminUrl = async () => {
-
 
36
    try {
-
 
37
      const response = await axios.get('/backend/signin-admin')
-
 
38
      const { data, success } = response.data
-
 
39
      if (!success) throw new Error(data)
-
 
40
      window.open(data)
-
 
41
    } catch (error) {
-
 
42
      dispatch(addNotification({ style: 'danger', msg: error.message }))
-
 
43
    }
-
 
44
  }
-
 
45
 
-
 
46
  return (
24
  return (
47
    <Widget>
25
    <Widget>
48
      <Widget.Body>
26
      <Widget.Body>
49
        <Avatar
27
        <Avatar
50
          src={image}
28
          src={image}
51
          alt={`${fullName} profile-image`}
29
          alt={`${fullName} profile-image`}
52
          sx={{ margin: '0 auto', width: 100, height: 100 }}
30
          sx={{ margin: '0 auto', width: 100, height: 100 }}
53
        />
31
        />
54
        <Typography variant='h2'>{fullName}</Typography>
32
        <Typography variant='h2' sx={{ textAlign: 'center' }}>
-
 
33
          {fullName}
-
 
34
        </Typography>
Línea 55... Línea 35...
55
 
35
 
56
        <Row>
36
        <Row>
57
          <Typography variant='overline'>
37
          <Typography variant='overline'>
58
            <VisibilityOutlined />
38
            <VisibilityOutlined />
Línea 66... Línea 46...
66
 
46
 
67
          <Typography variant='overline'>
47
          <Typography variant='overline'>
68
            <ShareOutlined />
48
            <ShareOutlined />
69
            {connections}
49
            {connections}
70
          </Typography>
-
 
71
 
-
 
72
          {/* <Options>
-
 
73
            {linkAdmin ? (
-
 
74
              <Options.Item onClick={getAdminUrl}>Administración</Options.Item>
-
 
75
            ) : null}
-
 
76
 
-
 
77
            {linkImpersonate ? (
-
 
78
              <Options.Item onClick={() => navigate('/impersonate')}>
-
 
79
                Personificar otro usuario
-
 
80
              </Options.Item>
-
 
81
            ) : null}
-
 
82
 
-
 
83
            <Options.Item onClick={() => navigate('/account-settings')}>
-
 
84
              Configuración de la cuenta
-
 
85
            </Options.Item>
-
 
86
            <Options.Item onClick={() => navigate('/privacy-policy')}>
-
 
87
              Política de privacidad
-
 
88
            </Options.Item>
-
 
89
            <Options.Item onClick={() => navigate('/cookies')}>
-
 
90
              Política de cookies
-
 
91
            </Options.Item>
-
 
92
            <Options.Item onClick={() => navigate('/signout')}>
-
 
93
              Cerrar sesión
-
 
94
            </Options.Item>
-
 
95
          </Options> */}
50
          </Typography>
96
        </Row>
51
        </Row>
97
      </Widget.Body>
52
      </Widget.Body>
98
    </Widget>
53
    </Widget>
99
  )
54
  )