Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14230 Rev 14814
Línea 7... Línea 7...
7
const SalaryModal = ({
7
const SalaryModal = ({
8
	closeModal,
8
	closeModal,
9
	dataLink
9
	dataLink
10
}) => {
10
}) => {
Línea 11... Línea 11...
11
 
11
 
12
	const currencyOptions = [
-
 
13
		{ label: 'Pesos mexicanos', value: 'MXN' }
-
 
14
	]
12
	const [currencyOptions, setCurrencyOptions] = useState([])
15
	const [isActive, setIsActive] = useState(false)
13
	const [isActive, setIsActive] = useState(false)
16
	const [currency, setCurrency] = useState(currencyOptions[0].value)
14
	const [currency, setCurrency] = useState(currencyOptions[0].value)
Línea 17... Línea 15...
17
	const { register, watch, setValue } = useForm()
15
	const { register, watch, setValue } = useForm()
18
 
16
 
19
	useEffect(() => {
17
	useEffect(() => {
20
		getData(dataLink)
18
		getData(dataLink)
21
			.then(({
19
			.then(({
22
				salary_visible,
20
				salary_visible,
23
				salary_currency,
21
				salary_currency,
-
 
22
				salary_min,
24
				salary_min,
23
				salary_max,
25
				salary_max }) => {
24
				currencies }) => {
26
				setCurrency(salary_currency)
25
				setCurrency(salary_currency)
27
				setValue('salary_min', salary_min)
26
				setValue('salary_min', salary_min)
28
				setValue('salary_max', salary_max)
-
 
-
 
27
				setValue('salary_max', salary_max)
29
				salary_visible === 'y' ? setIsActive(true) : setIsActive(false)
28
				salary_visible === 'y' ? setIsActive(true) : setIsActive(false)
30
 
29
				Object.entries(currencies).map(([value, key]) => setCurrencyOptions(prev => [...prev, { label: key, value: value }]))
Línea 31... Línea 30...
31
			})
30
			})
32
	}, [])
31
	}, [])