Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1456 Rev 1929
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect} from 'react'
2
import { useLocation } from 'react-router-dom'
2
import { useLocation } from 'react-router-dom'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import { useForm } from 'react-hook-form'
4
import { useForm } from 'react-hook-form'
5
import { CKEditor } from 'ckeditor4-react'
5
import { CKEditor } from 'ckeditor4-react'
Línea 6... Línea 6...
6
 
6
 
7
import { axios, CKEDITOR_OPTIONS } from '../../utils'
7
import { axios, CKEDITOR_OPTIONS } from '../../utils'
Línea 8... Línea -...
8
import { addNotification } from '../../redux/notification/notification.actions'
-
 
9
 
8
import { addNotification } from '../../redux/notification/notification.actions'
10
import Spinner from 'components/UI/Spinner'
9
 
Línea 11... Línea 10...
11
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
10
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
12
import Modal from 'components/UI/modal/Modal'
11
import Modal from 'components/UI/modal/Modal'
13
 
12
 
14
const OverviewModal = ({
13
const OverviewModal = ({
15
  isOpen = false,
14
  isOpen = false,
16
  overview = '',
15
  overview = '',
17
  id = '',
16
  id = '',
18
  closeModal = function () {},
-
 
19
  onComplete = function () {}
17
  closeModal = function () {},
20
}) => {
18
  onComplete = function () {}
Línea 21... Línea 19...
21
  const [loading, setLoading] = useState(false)
19
}) => {
Línea 29... Línea 27...
29
      profile: `/profile/my-profiles/extended/${id}`,
27
      profile: `/profile/my-profiles/extended/${id}`,
30
      group: `/group/my-groups/extended/${id}`
28
      group: `/group/my-groups/extended/${id}`
31
    }
29
    }
32
    const type = pathname.split('/')[1]
30
    const type = pathname.split('/')[1]
Línea 33... Línea -...
33
 
-
 
34
    setLoading(true)
-
 
35
 
31
 
36
    const formData = new FormData()
32
    const formData = new FormData()
Línea 37... Línea 33...
37
    formData.append('description', description)
33
    formData.append('description', description)
38
 
34
 
Línea 54... Línea 50...
54
        closeModal()
50
        closeModal()
55
      })
51
      })
56
      .catch((err) => {
52
      .catch((err) => {
57
        dispatch(addNotification({ style: 'danger', msg: err.message }))
53
        dispatch(addNotification({ style: 'danger', msg: err.message }))
58
      })
54
      })
59
      .finally(() => setLoading(false))
-
 
60
  })
55
  })
Línea 61... Línea 56...
61
 
56
 
62
  const removeModalTabIndex = () => {
57
  const removeModalTabIndex = () => {
63
    const modal = document.querySelector('.fade.modal.show')
58
    const modal = document.querySelector('.fade.modal.show')
Línea 82... Línea 77...
82
        onDialogShow={removeModalTabIndex}
77
        onDialogShow={removeModalTabIndex}
83
      />
78
      />
84
      {errors.description && (
79
      {errors.description && (
85
        <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>
80
        <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>
86
      )}
81
      )}
87
      {loading && <Spinner />}
-
 
88
    </Modal>
82
    </Modal>
89
  )
83
  )
90
}
84
}
Línea 91... Línea 85...
91
 
85