Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 8051 Rev 11152
Línea 3... Línea 3...
3
import SearchLocationInput from '../../../shared/SearchLocationInput'
3
import SearchLocationInput from '../../../shared/SearchLocationInput'
4
import SubmitModal from '../../../jobs/components/Modals/SubmitModal'
4
import SubmitModal from '../../../jobs/components/Modals/SubmitModal'
5
import { useForm } from 'react-hook-form'
5
import { useForm } from 'react-hook-form'
Línea 6... Línea 6...
6
 
6
 
7
const LocationModal = ({
7
const LocationModal = ({
8
    closeModal,
8
	closeModal,
9
    dataLink,
9
	dataLink,
10
    googleApiKey,
10
	googleApiKey,
11
    defaultData = ''
11
	defaultData = ''
Línea 12... Línea 12...
12
}) => {
12
}) => {
13
 
13
 
14
    const [isActive, setIsActive] = useState((defaultData.is_main === "y") ? true : false);
14
	const [isActive, setIsActive] = useState((defaultData.is_main === 'y') ? true : false)
Línea 15... Línea 15...
15
    const [value, setValue] = useState(defaultData.formatted_address)
15
	const [value, setValue] = useState(defaultData.formatted_address)
16
    const [data, setData] = useState({})
16
	const [data, setData] = useState({})
17
 
17
 
18
    return (
18
	return (
19
        <SubmitModal
19
		<SubmitModal
20
            title='Ubicación'
20
			title='Ubicación'
21
            closeModal={closeModal}
21
			closeModal={closeModal}
22
            submitData={{ ...data, is_main: isActive ? "y" : "n" }}
22
			submitData={{ ...data, is_main: isActive ? 'y' : 'n' }}
23
            postLink={dataLink}
23
			postLink={dataLink}
24
        >
24
		>
25
            <SearchLocationInput
25
			<SearchLocationInput
26
                value={value}
26
				value={value}
27
                setValue={setValue}
27
				setValue={setValue}
28
                googleApiKey={googleApiKey}
28
				googleApiKey={googleApiKey}
29
                updateData={setData}
29
				updateData={setData}
30
            />
30
			/>
31
            <div
31
			<div
32
                className={`toggle btn btn-primary ${!isActive && "off"}`}
32
				className={`toggle btn btn-primary ${!isActive && 'off'}`}
33
                data-toggle="toggle"
33
				data-toggle="toggle"
34
                role="button"
34
				role="button"
35
                style={{ width: '130px' }}
35
				style={{ width: '130px' }}
36
                onClick={() => setIsActive(!isActive)}
36
				onClick={() => setIsActive(!isActive)}
37
            >
37
			>
38
                <input
38
				<input
39
                    type="checkbox"
39
					type="checkbox"
40
                    checked={isActive}
40
					checked={isActive}
41
                />
41
				/>
42
                <div className="toggle-group">
42
				<div className="toggle-group">
43
                    <label for="status" className="btn btn-primary toggle-on">Principal</label>
43
					<label htmlFor="status" className="btn btn-primary toggle-on">Principal</label>
44
                    <label for="status" className="btn btn-light toggle-off">Secundaria</label>
44
					<label htmlFor="status" className="btn btn-light toggle-off">Secundaria</label>
45
                    <span className="toggle-handle btn btn-light"></span>
45
					<span className="toggle-handle btn btn-light"></span>
46
                </div>
46
				</div>
47
            </div>
47
			</div>
48
        </SubmitModal>
48
		</SubmitModal>
49
    )
49
	)