Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 676 Rev 677
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'
-
 
5
import { useDispatch } from 'react-redux'
-
 
6
import { addNotification } from '../../../redux/notification/notification.actions'
4
import MapOutlinedIcon from '@mui/icons-material/MapOutlined'
7
import MapOutlinedIcon from '@mui/icons-material/MapOutlined'
5
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined'
8
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined'
6
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'
9
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'
7
import styled from 'styled-components'
10
import styled from 'styled-components'
Línea 8... Línea 11...
8
 
11
 
9
import Paraphrase from '../../UI/Paraphrase'
12
import Paraphrase from '../../UI/Paraphrase'
10
import StyledContainer from '../WidgetLayout'
13
import StyledContainer from '../WidgetLayout'
11
import Options from '../../UI/Option'
-
 
Línea 12... Línea 14...
12
import { useHistory } from 'react-router-dom'
14
import Options from '../../UI/Option'
13
 
15
 
14
const StyledProfileContainer = styled(StyledContainer)`
16
const StyledProfileContainer = styled(StyledContainer)`
15
  padding: 10px;
17
  padding: 10px;
Línea 43... Línea 45...
43
    },
45
    },
44
    { label: 'Política de cookies', action: () => history.push('/cookies') },
46
    { label: 'Política de cookies', action: () => history.push('/cookies') },
45
    { label: 'Cerrar sesión', action: () => history.push('/signout') }
47
    { label: 'Cerrar sesión', action: () => history.push('/signout') }
46
  ])
48
  ])
47
  const history = useHistory()
49
  const history = useHistory()
-
 
50
  const dispatch = useDispatch()
-
 
51
 
-
 
52
  const getAdminUrl = () => {
-
 
53
    axios
-
 
54
      .get('/backend/signin-admin')
-
 
55
      .then(({ data: responseData }) => {
-
 
56
        const { data, success } = responseData
-
 
57
 
-
 
58
        if (!success) {
-
 
59
          throw new Error(data)
-
 
60
        }
Línea 48... Línea 61...
48
 
61
 
49
  const getAdminUrl = async () => {
62
        window.open(data)
50
    try {
-
 
51
      const { data } = await axios.get('/backend/signin-admin')
-
 
52
      if (data.success) window.open(data.data)
63
      })
53
    } catch (error) {
64
      .catch((err) => {
54
      console.log('>>: error > ', error)
65
        dispatch(addNotification({ style: 'danger', msg: err.message }))
55
    }
66
      })
Línea 56... Línea 67...
56
  }
67
  }
57
 
68
 
58
  useEffect(() => {
69
  useEffect(() => {
Línea 89... Línea 100...
89
          <ShareOutlinedIcon />
100
          <ShareOutlinedIcon />
90
          {connections}
101
          {connections}
91
        </span>
102
        </span>
92
      </StyledProfileStatus>
103
      </StyledProfileStatus>
Línea 93... Línea 104...
93
 
104
 
94
      <Options options={options.current} />
105
      <Options options={options.current} top='10px' right='10px' />
95
    </StyledProfileContainer>
106
    </StyledProfileContainer>
96
  )
107
  )