Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7375 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7375 Rev 7376
Línea 1... Línea 1...
1
import React from 'react'
1
import React, { Suspense } from 'react'
-
 
2
import parse from 'html-react-parser'
-
 
3
import styled from 'styled-components'
-
 
4
import { Container, Col } from 'react-bootstrap'
-
 
5
import {
-
 
6
  NavLink,
-
 
7
  Route,
-
 
8
  Switch,
-
 
9
  useHistory,
-
 
10
  useLocation,
-
 
11
} from 'react-router-dom'
-
 
12
import { useSelector } from 'react-redux'
Línea 2... Línea 13...
2
 
13
 
3
import Login from '../../components/auth/login/Login'
14
import Login from '../../components/auth/login/Login'
-
 
15
import Signup from '../../components/auth/signup/Signup'
-
 
16
import ForgotPassword from '../../components/auth/forgot-password/ForgotPassword'
-
 
17
 
-
 
18
const AuthContainer = styled(Container)`
-
 
19
  margin: auto;
-
 
20
  display: flex;
-
 
21
  padding: 2rem 0;
-
 
22
  @media (max-width: 768px) {
-
 
23
    flex-direction: column;
-
 
24
  }
-
 
25
`
-
 
26
const CompanyInfoContainer = styled(Col)`
-
 
27
  display: flex;
-
 
28
  flex-direction: column;
-
 
29
  justify-content: center;
-
 
30
  gap: 0.5rem;
-
 
31
  img {
-
 
32
    height: 50vh;
-
 
33
    object-fit: contain;
-
 
34
    width: 100%;
-
 
35
  }
-
 
36
  p {
-
 
37
    font-size: 1rem;
-
 
38
  }
-
 
39
  @media (min-width: 768px) {
-
 
40
    img {
-
 
41
      margin: 0 3rem;
-
 
42
    }
-
 
43
  }
-
 
44
`
-
 
45
 
-
 
46
const Auth = () => {
-
 
47
  const { pathname } = useLocation()
-
 
48
  const history = useHistory()
-
 
49
  const { logo_url, intro } = useSelector(({ auth }) => auth)
-
 
50
 
-
 
51
  if (pathname === '/') {
-
 
52
    history.push('/signin')
Línea 4... Línea -...
4
import AuthLayout from '../../layouts/auth/AuthLayout'
-
 
5
 
53
  }
-
 
54
 
-
 
55
  return (
-
 
56
    <AuthContainer forwardedAs="main">
-
 
57
      <CompanyInfoContainer forwardedAs="section" lg="6">
-
 
58
        <img src={logo_url} alt="Leaderslinked logo" />
-
 
59
        <p>{parse(intro)}</p>
-
 
60
      </CompanyInfoContainer>
-
 
61
 
-
 
62
      <Col forwardedAs="section">
-
 
63
        <ul className="sign-control">
-
 
64
          <li>
-
 
65
            <NavLink to="/signin" activeClassName="current">
-
 
66
              Entrar
-
 
67
            </NavLink>
-
 
68
          </li>
-
 
69
          <li>
-
 
70
            <NavLink to="/signup" activeClassName="current">
-
 
71
              Registrarse
-
 
72
            </NavLink>
-
 
73
          </li>
-
 
74
          <li>
-
 
75
            <NavLink to="/forgot-password" activeClassName="current">
-
 
76
              Olvide mi clave
6
const SigninPage = () => {
77
            </NavLink>
-
 
78
          </li>
-
 
79
        </ul>
-
 
80
        <Suspense fallback={null}>
-
 
81
          <div className="sign_in_sec current">
-
 
82
            <Switch>
-
 
83
              <Route exact path="/signin">
-
 
84
                <Login />
-
 
85
              </Route>
-
 
86
              <Route exact path="/signup">
-
 
87
                <Signup />
-
 
88
              </Route>
-
 
89
              <Route exact path="/forgot-password">
-
 
90
                <ForgotPassword />
-
 
91
              </Route>
-
 
92
            </Switch>
7
  return (
93
          </div>
8
    <AuthLayout>
94
        </Suspense>
9
      <Login />
95
      </Col>
10
    </AuthLayout>
96
    </AuthContainer>
Línea 11... Línea 97...
11
  )
97
  )