Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11131 Rev 11139
Línea 1... Línea 1...
1
import React, { useState, useEffect } from 'react'
1
import React, { useState } from 'react'
2
import Datetime from 'react-datetime'
2
import Datetime from 'react-datetime'
3
import { useForm } from 'react-hook-form'
3
import { useForm } from 'react-hook-form'
4
import { getData } from '../../../helpers/fetchHelpers'
-
 
5
import SearchLocationInput from '../../../shared/SearchLocationInput'
4
import SearchLocationInput from '../../../shared/SearchLocationInput'
6
import SubmitModal from './SubmitModal'
5
import SubmitModal from './SubmitModal'
Línea 7... Línea 6...
7
 
6
 
8
const jobTypeOptions = [
7
const jobTypeOptions = [
9
	{ label: 'Tiempo completo', value: 'f' },
8
	{ label: 'Tiempo completo', value: 'f' },
10
	{ label: 'Tiempo parcial', value: 'p' },
9
	{ label: 'Tiempo parcial', value: 'p' },
11
	{ label: 'Contratado', value: 'c' },
10
	{ label: 'Contratado', value: 'c' },
12
	{ label: 'Temporal', value: 't' },
11
	{ label: 'Temporal', value: 't' },
Línea 13... Línea 12...
13
]
12
]
Línea 14... Línea 13...
14
 
13
 
15
const AddModal = ({ closeModal, dataLink, googleApiKey }) => {
14
const AddModal = ({ closeModal, dataLink, googleApiKey, jobCategoryOptions }) => {
16
 
15
 
17
	const { register, watch } = useForm()
16
	const { register, watch } = useForm()
18
	const [year, setYear] = useState()
-
 
19
	const [value, setValue] = useState('')
-
 
20
	const [data, setData] = useState({})
-
 
21
	const [jobCategoryOptions, setJobsCategoryOptions] = useState([])
-
 
22
 
-
 
23
	useEffect(() => {
-
 
24
		getData(dataLink)
-
 
25
			.then(({ job_categories }) => {
-
 
26
 
-
 
27
				Object.entries(job_categories).map(([key, value]) => {
-
 
28
					setJobsCategoryOptions(prev => [...prev, { value: key, name: value }])
-
 
Línea 29... Línea 17...
29
				})
17
	const [year, setYear] = useState()
30
			})
18
	const [value, setValue] = useState('')
31
	}, [dataLink])
19
	const [data, setData] = useState({})
32
 
20