Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1861 Rev 1862
Línea 1... Línea 1...
1
import React, { useEffect, useMemo, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
3
import { IconButton } from '@mui/material'
3
import { IconButton } from '@mui/material'
4
import { Edit } from '@mui/icons-material'
4
import { Edit } from '@mui/icons-material'
Línea 5... Línea -...
5
 
-
 
6
import { formatObjectToArray } from '@app/utils'
5
 
7
import { updateSkills } from '@app/services/profiles'
6
import { updateSkills } from '@app/services/profiles'
Línea 8... Línea 7...
8
import { addNotification } from '@app/redux/notification/notification.actions'
7
import { addNotification } from '@app/redux/notification/notification.actions'
9
 
8
 
Línea 18... Línea 17...
18
}) => {
17
}) => {
19
  const [skills, setSkills] = useState([])
18
  const [skills, setSkills] = useState([])
20
  const [showModal, setShowModal] = useState(false)
19
  const [showModal, setShowModal] = useState(false)
21
  const labels = useSelector(({ intl }) => intl.labels)
20
  const labels = useSelector(({ intl }) => intl.labels)
22
  const dispatch = useDispatch()
21
  const dispatch = useDispatch()
23
  const usersSkills = useMemo(() => {
-
 
24
    console.log('on format skills')
-
 
25
    return formatObjectToArray(defaultSkills)
-
 
26
  }, [defaultSkills])
-
 
Línea 27... Línea 22...
27
 
22
 
Línea 28... Línea 23...
28
  const toggleModal = () => setShowModal(!showModal)
23
  const toggleModal = () => setShowModal(!showModal)
29
 
24
 
Línea 43... Línea 38...
43
        dispatch(addNotification({ style: 'danger', msg: error.message }))
38
        dispatch(addNotification({ style: 'danger', msg: error.message }))
44
      })
39
      })
45
  }
40
  }
Línea 46... Línea 41...
46
 
41
 
47
  useEffect(() => {
-
 
48
    console.log('on set skills')
42
  useEffect(() => {
49
    setSkills(usersSkills)
43
    setSkills(defaultSkills)
Línea 50... Línea 44...
50
  }, [usersSkills])
44
  }, [defaultSkills])
51
 
45
 
52
  return (
46
  return (
53
    <>
47
    <>