Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1650 Rev 1664
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
-
 
3
import { useForm } from 'react-hook-form'
2
import { useForm } from 'react-hook-form'
-
 
3
import { useDispatch, useSelector } from 'react-redux'
Línea 4... Línea 4...
4
 
4
 
5
import { sendReport } from '@app/services/reports'
5
import { block_options, reasons } from '@app/constants/report'
6
import { addNotification } from '@app/redux/notification/notification.actions'
6
import { addNotification } from '@app/redux/notification/notification.actions'
7
import { closeReportModal } from '@app/redux/report/report.actions'
7
import { closeReportModal } from '@app/redux/report/report.actions'
Línea 8... Línea -...
8
import { block_options, reasons } from '@app/constants/report'
-
 
9
 
-
 
10
import Modal from '../UI/modal/Modal'
8
import { sendReport } from '@app/services/reports'
-
 
9
 
-
 
10
import FormInputText from '../UI/form/FormInputText'
Línea 11... Línea 11...
11
import SelectInput from '../UI/form/SelectField'
11
import SelectInput from '../UI/form/SelectField'
12
import FormInputText from '../UI/form/FormInputText'
12
import Modal from '../UI/modal/Modal'
13
 
13
 
14
export default function ReportModal() {
14
export default function ReportModal() {
15
  const { showModal, type, reportUrl, onComplete } = useSelector(
15
  const { showModal, type, reportUrl, onComplete } = useSelector(
Línea 16... Línea 16...
16
    (state) => state.report
16
    (state) => state.report
Línea 17... Línea 17...
17
  )
17
  )
18
  const dispatch = useDispatch()
18
  const dispatch = useDispatch()
19
 
19
 
20
  const { control, errors, getValues } = useForm()
20
  const { control, errors, getValues, handleSubmit } = useForm()
Línea 21... Línea 21...
21
 
21
 
Línea 35... Línea 35...
35
      dispatch(addNotification({ style: 'success', msg: data.message }))
35
      dispatch(addNotification({ style: 'success', msg: data.message }))
36
      dispatch(closeReportModal())
36
      dispatch(closeReportModal())
37
    } catch (error) {
37
    } catch (error) {
38
      dispatch(addNotification({ style: 'danger', msg: error.message }))
38
      dispatch(addNotification({ style: 'danger', msg: error.message }))
39
    }
39
    }
40
  }
40
  })
Línea 41... Línea 41...
41
 
41
 
Línea 42... Línea 42...
42
  const closeModal = () => dispatch(closeReportModal())
42
  const closeModal = () => dispatch(closeReportModal())
43
 
43