Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12749 Rev 12791
Línea 4... Línea 4...
4
import { useForm } from 'react-hook-form'
4
import { useForm } from 'react-hook-form'
5
import DescriptionInput from '../../../shared/DescriptionInput'
5
import DescriptionInput from '../../../shared/DescriptionInput'
Línea 6... Línea 6...
6
 
6
 
Línea 7... Línea 7...
7
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
7
const SectionModal = ({ show, closeModal, section, onSubmit }) => {
Línea 8... Línea 8...
8
 
8
 
9
	const { handleSubmit, errors, register } = useForm()
9
	const { handleSubmit, errors, register, setValue, watch } = useForm()
10
 
10
 
11
	const submit = (data) => {
11
	const submit = (data) => {
Línea 25... Línea 25...
25
						<input type="text" name='name' className='form-control' ref={register({ required: true })} />
25
						<input type="text" name='name' className='form-control' ref={register({ required: true })} />
26
						{errors.name && <p>{errors.name.message}</p>}
26
						{errors.name && <p>{errors.name.message}</p>}
27
					</div>
27
					</div>
28
					<div className='form-group'>
28
					<div className='form-group'>
29
						<label className="form-label">Texto</label>
29
						<label className="form-label">Texto</label>
30
						{/* <DescriptionInput
30
						<DescriptionInput
31
							defaultValue={watch('text') ? parse(watch('text')) : ''}
31
							defaultValue={watch('text') ? parse(watch('text')) : ''}
32
							name='text'
32
							name='text'
33
							onChange={setValue}
33
							onChange={setValue}
34
						/> */}
34
						/>
35
					</div>
35
					</div>
36
				</Modal.Body>
36
				</Modal.Body>
37
				<Modal.Footer>
37
				<Modal.Footer>
38
					<Button
38
					<Button
39
						variant="primary"
39
						variant="primary"
40
						type='submit'
40
						type='submit'
41
					>
41
					>
42
                        Enviar
42
						Enviar
43
					</Button>
43
					</Button>
44
					<Button variant="danger" onClick={closeModal}>
44
					<Button variant="danger" onClick={closeModal}>
45
                        Cancelar
45
						Cancelar
46
					</Button>
46
					</Button>
47
				</Modal.Footer>
47
				</Modal.Footer>
48
			</form>
48
			</form>
49
		</Modal >
49
		</Modal >
50
	)
50
	)