Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 8437 Rev 8449
Línea 8... Línea 8...
8
    modalData,
8
    modalData,
9
    closeModal,
9
    closeModal,
10
    dataLink
10
    dataLink
11
}) => {
11
}) => {
Línea -... Línea 12...
-
 
12
 
-
 
13
    const currencyOptions = [
-
 
14
        { label: "Pesos mexicanos", value: "MXN" }
12
 
15
    ]
-
 
16
    const [isActive, setIsActive] = useState(false)
13
    const [isActive, setIsActive] = useState(false)
17
    const [currency, setCurrency] = useState("")
Línea 14... Línea 18...
14
    const { register, watch } = useForm()
18
    const { register, watch } = useForm()
15
 
19
 
16
    useEffect(() => {
20
    useEffect(() => {
17
        getData(dataLink)
21
        getData(dataLink)
Línea 18... Línea 22...
18
            .then(res => console.log(res))
22
            .then(res => console.log(res))
19
    }, [])
23
    }, [])
20
 
24
 
21
    return (
25
    return (
22
        <SubmitModal
26
        <SubmitModal
23
            title='Título'
27
            title='Salario'
-
 
28
            closeModal={closeModal}
24
            closeModal={closeModal}
29
            submitData={{
25
            submitData={{
30
                salary_visible: isActive ? "y" : "n",
26
                salary_visible: isActive ? "y" : "n",
31
                salary_currency: currency,
27
                salary_min: watch("minimo"),
32
                salary_min: watch("minimo"),
28
                salary_max: watch("maximo")
33
                salary_max: watch("maximo")
29
            }}
34
            }}
30
            postLink={dataLink}
35
            postLink={dataLink}
31
        >
36
        >
32
            <div
37
            <div
33
                className={`toggle btn btn-primary ${!isActive && "off"}`}
38
                className={`toggle btn btn-block btn-primary ${!isActive && "off"}`}
34
                data-toggle="toggle"
39
                data-toggle="toggle"
35
                role="button"
40
                role="button"
36
                style={{ width: '130px' }}
41
                style={{ width: '130px' }}
37
                onClick={() => setIsActive(!isActive)}
42
                onClick={() => setIsActive(!isActive)}
38
            >
43
            >
39
                <input
44
                <input
40
                    type="checkbox"
45
                    type="checkbox"
41
                    checked={isActive}
46
                    checked={isActive}
42
                />
47
                />
43
                <div className="toggle-group">
48
                <div className="toggle-group">
44
                    <label for="status" className="btn btn-primary toggle-on">Principal</label>
49
                    <label for="status" className="btn btn-primary toggle-on">Mostrar</label>
45
                    <label for="status" className="btn btn-light toggle-off">Secundaria</label>
50
                    <label for="status" className="btn btn-light toggle-off">No mostrar</label>
46
                    <span className="toggle-handle btn btn-light"></span>
51
                    <span className="toggle-handle btn btn-light"></span>
-
 
52
                </div>
-
 
53
            </div>
-
 
54
            <div className='form-group'>
-
 
55
                <label className="form-label">Moneda</label>
-
 
56
                <select
-
 
57
                    className='form-control'
-
 
58
                    name="employment_type"
-
 
59
                    onChange={(e) => setCurrency(e.target.value)}
-
 
60
                >
-
 
61
                    {
-
 
62
                        currencyOptions.map(({ value, label }) => (
-
 
63
                            <option key={value} value={value}>{label}</option>
-
 
64
                        ))
-
 
65
                    }
-
 
66
                </select>
47
                </div>
67
 
48
            </div>
68
            </div>
49
            <div className='form-group'>
69
            <div className='form-group'>
50
                <label className="form-label">Minimo</label>
70
                <label className="form-label">Minimo</label>
51
                <input
71
                <input