Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1902 Rev 2194
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { useParams } from 'react-router-dom'
2
import { useParams } from 'react-router-dom'
3
import { useSelector } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
4
import { getBackendVars } from '../../services/backendVars'
4
import { getBackendVars } from '../../services/backendVars'
Línea 5... Línea 5...
5
 
5
 
6
import ProfileInfo from '../../components/ProfileInfo'
6
import ProfileInfo from '../../components/ProfileInfo'
7
import Cover from '../../components/UI/cover/Cover'
7
import Cover from '../../components/UI/cover/Cover'
Línea 12... Línea 12...
12
import Languages from '../../components/profile/languages/LanguagesCard'
12
import Languages from '../../components/profile/languages/LanguagesCard'
13
import Educations from '../../components/educations/Educations'
13
import Educations from '../../components/educations/Educations'
14
import Experiences from '../../components/experiences/Experiences'
14
import Experiences from '../../components/experiences/Experiences'
15
import SuggestWidget from '../../components/widgets/default/SuggestWidget'
15
import SuggestWidget from '../../components/widgets/default/SuggestWidget'
16
import HobbiesAndInterests from '../../components/profile/hobbies/HobbiesCard.jsx'
16
import HobbiesAndInterests from '../../components/profile/hobbies/HobbiesCard.jsx'
-
 
17
import { addNotification } from '@app/redux/notification/notification.actions'
Línea 17... Línea 18...
17
 
18
 
18
const ProfileView = () => {
19
const ProfileView = () => {
19
  const [profile, setProfile] = useState(null)
20
  const [profile, setProfile] = useState(null)
20
  const labels = useSelector(({ intl }) => intl.labels)
21
  const labels = useSelector(({ intl }) => intl.labels)
-
 
22
  const { uuid } = useParams()
Línea 21... Línea 23...
21
  const { uuid } = useParams()
23
  const dispatch = useDispatch()
22
 
24
 
23
  useEffect(() => {
25
  useEffect(() => {
24
    getBackendVars(`/profile/view/${uuid}`)
26
    getBackendVars(`/profile/view/${uuid}`)
Línea 36... Línea 38...
36
          })
38
          })
37
        })
39
        })
Línea 38... Línea 40...
38
 
40
 
39
        setProfile(vars)
41
        setProfile(vars)
40
      })
42
      })
41
      .catch((err) => {
43
      .catch((error) => {
42
        console.log(`Error: ${err}`)
-
 
43
        throw new Error(err)
44
        dispatch(addNotification({ style: 'danger', msg: error.message }))
44
      })
45
      })
Línea 45... Línea 46...
45
  }, [])
46
  }, [])
46
 
47