Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1967 Rev 1968
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { useState } from 'react'
2
import { useState } from 'react'
-
 
3
import Spinner from '../../../shared/loading-spinner/Spinner';
Línea -... Línea 4...
-
 
4
 
-
 
5
const StyledSpinnerContainer = styled.div`
-
 
6
  position: absolute;
-
 
7
  left: 0;
-
 
8
  top: 0;
-
 
9
  width: 100%;
-
 
10
  height: 100%;
-
 
11
  background: rgba(255, 255, 255, 0.4);
-
 
12
  display: flex;
-
 
13
  justify-content: center;
-
 
14
  align-items: center;
-
 
15
  z-index: 300;
3
 
16
`;
4
function CloseAccount() {
17
function CloseAccount() {
-
 
18
    const [showInputCode, setShowInputCode] = useState(false);
5
    const [showInputCode, setShowInputCode] = useState(false);
19
    const [loading, setLoading] = useState(false);
6
    const handleGetCode  = () => {
20
    const handleGetCode  = () => {
7
        try {
21
        try {
8
            setShowInputCode(true)
22
            setShowInputCode(true)
9
            console.log('>>: get code')        
23
            console.log('>>: get code')        
10
        } catch (error) {
24
        } catch (error) {
11
            console.log('>>: error > ', error)
25
            console.log('>>: error > ', error)
12
        }
26
        }
-
 
27
    }
-
 
28
    const handleSubmit = (e) => {
-
 
29
        try {
-
 
30
            setLoading(true)
-
 
31
            e.preventDefault();
-
 
32
 
-
 
33
        } catch (error) {
-
 
34
            console.log('>>: error > ', error)
-
 
35
        }finally{
-
 
36
            setLoading(false)
-
 
37
        }
13
    }
38
    }
14
    return (
39
    return (
15
        <div className="acc-setting h-100" style={{ position: "relative" }}>
40
        <div className="acc-setting h-100" style={{ position: "relative" }}>
16
            <div className="container">
41
            <div className="container">
17
                <h1>¿Esta seguro de eliminar su cuenta?</h1>
42
                <h1>¿Esta seguro de eliminar su cuenta?</h1>
Línea 24... Línea 49...
24
                    </div>
49
                    </div>
25
                </div>
50
                </div>
26
            </div>
51
            </div>
27
            {
52
            {
28
                showInputCode && (
53
                showInputCode && (
-
 
54
                    <form onSubmit={handleSubmit}>
29
                    <div>
55
                        <div class="form-group">
-
 
56
                            <label for="exampleInputEmail1">Ingrese el codigo</label>
-
 
57
                            <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Ingrese el codigo" />
-
 
58
                            <small id="emailHelp" class="form-text text-muted">Este codigo fue enviado a tu correo electrónico.</small>
30
                        input code
59
                        </div>
-
 
60
                        <button type="submit" class="btn btn-primary">Submit</button>
31
                    </div>
61
                    </form>
32
                )
62
                )
33
            }
63
            }
-
 
64
            {loading && (
-
 
65
                <StyledSpinnerContainer>
-
 
66
                    <Spinner />
-
 
67
                </StyledSpinnerContainer>
-
 
68
            )}
34
        </div>
69
        </div>
35
    )
70
    )
36
}
71
}
Línea 37... Línea 72...
37
 
72
 
38
export default CloseAccount
73
export default CloseAccount