Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2864 Rev 2865
Línea 1... Línea 1...
1
import React, { useRef, useState, useEffect } from 'react'
1
import React, { useRef, useState, useEffect } from 'react'
2
import { Link } from 'react-router-dom'
2
import { Link } from 'react-router-dom'
3
import { useForm } from 'react-hook-form'
3
import { useForm } from 'react-hook-form'
4
import { useDispatch, useSelector } from 'react-redux'
4
import { useDispatch, useSelector } from 'react-redux'
-
 
5
import { styled, Typography } from '@mui/material'
5
import { Mail, Lock, Person, CheckCircleOutline } from '@mui/icons-material'
6
import { Mail, Lock, Person, CheckCircleOutline } from '@mui/icons-material'
6
import Recaptcha from 'react-recaptcha'
7
import Recaptcha from 'react-recaptcha'
7
import styled from 'styled-components'
-
 
Línea 8... Línea 8...
8
 
8
 
9
import { axios } from '../../utils'
9
import { axios } from '@utils'
10
import { addNotification } from '../../redux/notification/notification.actions'
10
import { addNotification } from '@store/notification/notification.actions'
11
import CryptoJSAesJson from '../../utils/crypto-js/cryptojs-aes-format'
11
import CryptoJSAesJson from '@utils/crypto-js/cryptojs-aes-format'
12
 
12
 
13
import Spinner from 'components/UI/Spinner'
13
import Input from '@components/UI/inputs/Input'
14
import AuthForm from '../../components/auth/AuthForm'
14
import Button from '@components/UI/buttons/Buttons'
15
import Input from 'components/UI/form/FormInputText'
15
import Spinner from '@components/UI/Spinner'
16
import SwitchInput from 'components/UI/SwitchInput'
16
import AuthForm from '@components/auth/AuthForm'
17
import Checkbox from 'components/UI/checkbox/Checkbox'
17
import SwitchInput from '@components/UI/SwitchInput'
18
import Button from '@app/components/UI/buttons/Buttons'
-
 
Línea 19... Línea 18...
19
import { Typography } from '@mui/material'
18
import CheckboxInput from '@components/UI/inputs/Checkbox'
20
 
19
 
21
const StyledCheck = styled.div`
20
const StyledCheck = styled('div')`
22
  display: flex;
21
  display: flex;
23
  flex-direction: column;
22
  flex-direction: column;
24
  justify-content: center;
23
  justify-content: center;
25
  align-items: center;
24
  align-items: center;
26
  gap: 0.5rem;
25
  gap: 0.5rem;
27
  p {
26
  p {
28
    text-align: center;
27
    text-align: center;
29
  }
28
  }
30
`
29
`
31
const StyledSpinnerContainer = styled.div`
30
const StyledSpinnerContainer = styled('div')`
32
  position: absolute;
31
  position: absolute;
33
  left: 0;
32
  left: 0;
34
  top: 0;
33
  top: 0;
Línea 164... Línea 163...
164
 
163
 
165
      <Input
164
      <Input
166
        type='email'
165
        type='email'
167
        name='email'
166
        name='email'
168
        placeholder='Correo electrónico'
167
        placeholder='Correo electrónico'
169
        icon={Mail}
168
        icon={<Mail />}
170
        control={control}
169
        control={control}
171
        rules={{
170
        rules={{
172
          required: 'Este campo es requerido',
171
          required: 'Este campo es requerido',
173
          pattern: {
172
          pattern: {
Línea 179... Línea 178...
179
      />
178
      />
Línea 180... Línea 179...
180
 
179
 
181
      <Input
180
      <Input
182
        type='text'
181
        type='text'
183
        name='first_name'
182
        name='first_name'
184
        icon={Person}
183
        icon={<Person />}
185
        placeholder='Nombre'
184
        placeholder='Nombre'
186
        control={control}
185
        control={control}
187
        rules={{
186
        rules={{
188
          required: 'Este campo es requerido',
187
          required: 'Este campo es requerido',
Línea 195... Línea 194...
195
      />
194
      />
Línea 196... Línea 195...
196
 
195
 
197
      <Input
196
      <Input
198
        type='text'
197
        type='text'
199
        name='last_name'
198
        name='last_name'
200
        icon={Person}
199
        icon={<Person />}
201
        placeholder='Apellido'
200
        placeholder='Apellido'
202
        control={control}
201
        control={control}
203
        rules={{
202
        rules={{
204
          required: 'Este campo es requerido',
203
          required: 'Este campo es requerido',
Línea 211... Línea 210...
211
      />
210
      />
Línea 212... Línea 211...
212
 
211
 
213
      <Input
212
      <Input
214
        type='password'
213
        type='password'
215
        name='password'
214
        name='password'
216
        icon={Lock}
215
        icon={<Lock />}
217
        placeholder='Clave'
216
        placeholder='Clave'
218
        control={control}
217
        control={control}
219
        rules={{
218
        rules={{
220
          required: 'Este campo es requerido',
219
          required: 'Este campo es requerido',
Línea 229... Línea 228...
229
      />
228
      />
Línea 230... Línea 229...
230
 
229
 
231
      <Input
230
      <Input
232
        type='password'
231
        type='password'
233
        name='confirmation'
232
        name='confirmation'
234
        icon={Lock}
233
        icon={<Lock />}
235
        placeholder='Confirme su clave'
234
        placeholder='Confirme su clave'
236
        control={control}
235
        control={control}
237
        rules={{
236
        rules={{
238
          required: 'Este campo es requerido',
237
          required: 'Este campo es requerido',
Línea 246... Línea 245...
246
      <SwitchInput
245
      <SwitchInput
247
        label='Eres mayor de 18'
246
        label='Eres mayor de 18'
248
        setValue={(value) => setIsAdult(value)}
247
        setValue={(value) => setIsAdult(value)}
249
      />
248
      />
Línea 250... Línea 249...
250
 
249
 
251
      <Checkbox
250
      <CheckboxInput
252
        name='terms_and_conditions'
251
        name='terms_and_conditions'
253
        control={control}
252
        control={control}
254
        label='Si, acepto los Términos y Condiciones.'
-
 
255
        rules={{
253
        label='Si, acepto los Términos y Condiciones.'
256
          required: 'Este campo es requerido'
-
 
257
        }}
254
        rules={{ required: 'Este campo es requerido' }}
258
        error={errors.terms_and_conditions?.message}
255
        error={errors.terms_and_conditions?.message}
Línea 259... Línea 256...
259
      />
256
      />
260
 
257