Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2645 Rev 4113
Línea 23... Línea 23...
23
`;
23
`;
Línea 24... Línea 24...
24
 
24
 
25
const BasicSettings = (props) => {
25
const BasicSettings = (props) => {
26
  // redux destructuring
26
  // redux destructuring
-
 
27
  const { addNotification } = props;
-
 
28
  
Línea 27... Línea 29...
27
  const { addNotification } = props;
29
  const {  timezones } = props;
28
 
30
 
Línea 29... Línea 31...
29
  // states
31
  // states
30
  const [loading, setLoading] = useState(false);
32
  const [loading, setLoading] = useState(false);
31
 
33
 
32
  const { register, handleSubmit, setValue, watch, setError, errors } = useForm(
34
  const { register, handleSubmit, setValue, watch, setError, errors } = useForm(
-
 
35
    {
33
    {
36
      defaultValues: {
34
      defaultValues: {
37
        phone: "",
35
        phone: "",
38
        timezone: "",
Línea 36... Línea 39...
36
      },
39
      },
37
    }
40
    }
38
  );
41
  );
39
 
42
 
-
 
43
  useEffect(() => {
-
 
44
    register("phone", {
-
 
45
      required: "Por favor ingrese su número de teléfono",
40
  useEffect(() => {
46
    });
Línea 41... Línea 47...
41
    register("phone", {
47
    register("timezone", {
42
      required: "Por favor ingrese su número de teléfono",
48
      required: "Por favor ingrese su zona horaria",
43
    });
49
    });
Línea 166... Línea 172...
166
                <option value="m">Masculino</option>
172
                <option value="m">Masculino</option>
167
                <option value="f">Femenino</option>
173
                <option value="f">Femenino</option>
168
              </select>
174
              </select>
169
              {<FormErrorFeedback>{errors?.gender?.message}</FormErrorFeedback>}
175
              {<FormErrorFeedback>{errors?.gender?.message}</FormErrorFeedback>}
170
            </div>
176
            </div>
-
 
177
           </div>  
-
 
178
           <div className="d-flex flex-wrap" style={{ gap: '1rem' }}>
-
 
179
            <div className="cp-field">
-
 
180
            	<label htmlFor="timezone">Zona horaria</label>
-
 
181
	            <select
-
 
182
	                name="timezone"
-
 
183
	                id="timezone"
-
 
184
	                defaultValue=""
-
 
185
	                ref={register({
-
 
186
	                  required: "Por favor elige una Zona horaria",
-
 
187
	                })}
-
 
188
	              >
-
 
189
	                <option value="" hidden>
-
 
190
	                  Zona horaria
-
 
191
	                </option>
-
 
192
	                {Object.entries(self.timezones).map(([key, value]) => (
-
 
193
	                  <option value={key} key={key}>
-
 
194
	                    {value}
-
 
195
	                  </option>
-
 
196
	                ))}
-
 
197
	              </select>
-
 
198
              	  {<FormErrorFeedback>{errors?.timezone?.message}</FormErrorFeedback>}
-
 
199
            </div>
171
            <div className="col-6 mx-auto d-flex align-items-center justify-content-center">
200
            <div className="col-6 mx-auto d-flex align-items-center justify-content-center">
172
              <button type="submit" className="btn btn-secondary mt-4">
201
              <button type="submit" className="btn btn-secondary mt-4">
173
                Guardar
202
                Guardar
174
              </button>
203
              </button>
175
            </div>
204
            </div>