Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1507 Rev 2614
Línea 1... Línea 1...
1
import React, { useRef, useEffect } from 'react'
1
import React, { useRef, useEffect } from 'react'
2
import { axios } from '../../../utils'
2
import { axios } from '../../../utils'
3
import { Avatar } from '@mui/material'
3
import { Avatar } from '@mui/material'
4
import { useHistory } from 'react-router-dom'
4
import { useNavigate } from 'react-router-dom'
5
import { useDispatch } from 'react-redux'
5
import { useDispatch } from 'react-redux'
6
import { addNotification } from '../../../redux/notification/notification.actions'
6
import { addNotification } from '../../../redux/notification/notification.actions'
7
import MapOutlinedIcon from '@mui/icons-material/MapOutlined'
7
import MapOutlinedIcon from '@mui/icons-material/MapOutlined'
8
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined'
8
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined'
9
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'
9
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'
Línea 32... Línea 32...
32
  country,
32
  country,
33
  connections,
33
  connections,
34
  linkAdmin,
34
  linkAdmin,
35
  linkImpersonate
35
  linkImpersonate
36
}) {
36
}) {
-
 
37
  const navigate = useNavigate()
-
 
38
  const dispatch = useDispatch()
37
  const options = useRef([
39
  const options = useRef([
38
    {
40
    {
39
      label: 'Configuración de la cuenta',
41
      label: 'Configuración de la cuenta',
40
      action: () => history.push('/account-settings')
42
      action: () => navigate('/account-settings')
41
    },
43
    },
42
    {
44
    {
43
      label: 'Política de privacidad',
45
      label: 'Política de privacidad',
44
      action: () => history.push('/privacy-policy')
46
      action: () => navigate('/privacy-policy')
45
    },
47
    },
46
    { label: 'Política de cookies', action: () => history.push('/cookies') },
48
    { label: 'Política de cookies', action: () => navigate('/cookies') },
47
    { label: 'Cerrar sesión', action: () => history.push('/signout') }
49
    { label: 'Cerrar sesión', action: () => navigate('/signout') }
48
  ])
50
  ])
49
  const history = useHistory()
-
 
50
  const dispatch = useDispatch()
-
 
Línea 51... Línea 51...
51
 
51
 
52
  const getAdminUrl = () => {
52
  const getAdminUrl = () => {
53
    axios
53
    axios
54
      .get('/backend/signin-admin')
54
      .get('/backend/signin-admin')
Línea 71... Línea 71...
71
      options.current.unshift({ label: 'Administración', action: getAdminUrl })
71
      options.current.unshift({ label: 'Administración', action: getAdminUrl })
Línea 72... Línea 72...
72
 
72
 
73
    if (linkImpersonate)
73
    if (linkImpersonate)
74
      options.current.unshift({
74
      options.current.unshift({
75
        label: 'Personificar otro usuario',
75
        label: 'Personificar otro usuario',
76
        action: () => history.push('/impersonate')
76
        action: () => navigate('/impersonate')
77
      })
77
      })
Línea 78... Línea 78...
78
  }, [])
78
  }, [])
79
 
79