Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14228 Rev 14230
Línea 3... Línea 3...
3
import React, { useEffect, useState } from 'react'
3
import React, { useEffect, useState } from 'react'
4
import { useForm } from 'react-hook-form'
4
import { useForm } from 'react-hook-form'
5
import { useDispatch } from 'react-redux'
5
import { useDispatch } from 'react-redux'
6
import { useHistory, useParams } from 'react-router-dom'
6
import { useHistory, useParams } from 'react-router-dom'
7
import { addNotification } from '../../redux/notification/notification.actions'
7
import { addNotification } from '../../redux/notification/notification.actions'
-
 
8
import ToggleComponent from '../../shared/ToggleComponent'
Línea 8... Línea 9...
8
 
9
 
9
const FormView = ({
10
const FormView = ({
10
	actionLink = '',
11
	actionLink = '',
11
	setActionLink = function () { }
12
	setActionLink = function () { }
Línea 56... Línea 57...
56
				}))
57
				}))
57
			})
58
			})
58
	}
59
	}
Línea 59... Línea 60...
59
 
60
 
-
 
61
	useEffect(() => {
-
 
62
		register('status')
-
 
63
	}, [])
-
 
64
 
60
	useEffect(() => {
65
	useEffect(() => {
61
		axios.get(actionLink)
66
		axios.get(actionLink)
62
			.then(({ data }) => {
67
			.then(({ data }) => {
63
				if (!data.success) {
68
				if (!data.success) {
64
					return dispatch(addNotification({
69
					return dispatch(addNotification({
Línea 124... Línea 129...
124
														</div>
129
														</div>
125
													</div>
130
													</div>
126
													<div className="col-4">
131
													<div className="col-4">
127
														<div className="form-group">
132
														<div className="form-group">
128
															<label>Nombre</label>
133
															<label>Nombre</label>
129
															<div
-
 
130
																className={`toggle btn btn-block btn-primary ${!watch('status') && 'off'}`}
-
 
131
																data-toggle="toggle"
-
 
132
																role="button"
134
															<ToggleComponent
133
																style={{ width: '130px' }}
135
																setValue={(e) => setValue('status', e)}
134
															>
-
 
135
																<input
-
 
136
																	type="checkbox"
-
 
137
																	ref={register}
-
 
138
																	name='status'
-
 
139
																/>
136
															/>
140
																<div className="toggle-group">
-
 
141
																	<label htmlFor="status" className="btn btn-primary toggle-on">Activo</label>
-
 
142
																	<label htmlFor="status" className="btn btn-light toggle-off">Inactivo</label>
-
 
143
																	<span className="toggle-handle btn btn-light"></span>
-
 
144
																</div>
-
 
145
															</div>
-
 
146
														</div>
137
														</div>
147
													</div>
138
													</div>
148
												</div>
139
												</div>
149
											</div>
140
											</div>
150
										</div>
141
										</div>