Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3679 Rev 3681
Línea -... Línea 1...
-
 
1
/* eslint-disable react/prop-types */
1
import React from "react";
2
import React from "react";
2
import { useRef, useState, useEffect } from "react";
3
import { useRef, useState, useEffect } from "react";
3
import { useForm } from "react-hook-form";
4
import { useForm } from "react-hook-form";
4
import styled from "styled-components";
5
import styled from "styled-components";
5
import { axios } from "../../../../utils";
6
import { axios } from "../../../../utils";
Línea 19... Línea 20...
19
  justify-content: center;
20
  justify-content: center;
20
  align-items: center;
21
  align-items: center;
21
  z-index: 300;
22
  z-index: 300;
22
`;
23
`;
Línea 23... Línea 24...
23
 
24
 
24
const Login = (props) => {
-
 
25
  // props destructuring
-
 
26
  const {
25
const Login = ({
27
    captchaKey,
26
  captchaKey,
28
    addNotification,
27
  addNotification,
29
    facebookOauth,
28
  facebookOauth,
30
    twitterOauth,
29
  twitterOauth,
31
    googleOauth,
30
  googleOauth,
32
    aes,
31
  aes,
Línea 33... Línea 32...
33
  } = props;
32
}) => {
34
 
33
 
35
  const {
34
  const {
36
    register,
35
    register,
37
    handleSubmit,
36
    handleSubmit,
38
    errors,
-
 
39
    setError,
37
    errors,
40
    clearErrors,
38
    setError,
41
    getValues,
39
    getValues,
Línea 42... Línea 40...
42
    setValue,
40
    setValue,
Línea 91... Línea 89...
91
              msg: resError,
89
              msg: resError,
92
            });
90
            });
93
          }
91
          }
94
        }
92
        }
95
      })
93
      })
96
      .catch((error) => {
94
      .catch((err) => console.log(`Error: ${err}`))
97
        setIsLoading(false);
95
      .finally(() => setIsLoading(false))
98
      });
-
 
99
    reCaptchaInstance.current.reset();
96
    reCaptchaInstance.current.reset();
100
    loginExpiredCallbackHandler();
97
    loginExpiredCallbackHandler();
101
    // setIsLoading(false);
98
    // setIsLoading(false);
102
    setValue("password", "");
99
    setValue("password", "");
103
  };
100
  };