|
@@ -0,0 +1,107 @@
|
|
1
|
+import { Modal } from 'react-bootstrap'
|
|
2
|
+import * as React from 'react';
|
|
3
|
+
|
|
4
|
+import {
|
|
5
|
+ Box, Stepper, Step,
|
|
6
|
+ StepLabel, Button , Typography
|
|
7
|
+} from '@mui/material'
|
|
8
|
+
|
|
9
|
+const steps = ['Información del candidato', 'Seleccionar plaza', 'Seleccionar pruebas', 'Confirmar'];
|
|
10
|
+
|
|
11
|
+export function HelpModal (props) {
|
|
12
|
+
|
|
13
|
+ let { visible, handleClose } = props
|
|
14
|
+
|
|
15
|
+ const [activeStep, setActiveStep] = React.useState(0);
|
|
16
|
+ const [skipped, setSkipped] = React.useState(new Set());
|
|
17
|
+
|
|
18
|
+ const isStepSkipped = (step) => {
|
|
19
|
+ return skipped.has(step);
|
|
20
|
+ };
|
|
21
|
+
|
|
22
|
+ const handleNext = () => {
|
|
23
|
+ let newSkipped = skipped;
|
|
24
|
+ if (isStepSkipped(activeStep)) {
|
|
25
|
+ newSkipped = new Set(newSkipped.values());
|
|
26
|
+ newSkipped.delete(activeStep);
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
30
|
+ setSkipped(newSkipped);
|
|
31
|
+ };
|
|
32
|
+
|
|
33
|
+ const handleBack = () => {
|
|
34
|
+ setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
35
|
+ };
|
|
36
|
+
|
|
37
|
+ const handleReset = () => {
|
|
38
|
+ setActiveStep(0);
|
|
39
|
+ };
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+ return (
|
|
43
|
+ <Modal size="lg"
|
|
44
|
+ aria-labelledby="contained-modal-title-vcenter"
|
|
45
|
+ centered show={visible}
|
|
46
|
+ onHide={handleClose}
|
|
47
|
+ >
|
|
48
|
+ <Modal.Header>
|
|
49
|
+ <button type="button" className="close" onClick={handleClose}>×</button>
|
|
50
|
+ <h4 className="modal-title">Crear Contraseña</h4>
|
|
51
|
+ </Modal.Header>
|
|
52
|
+ <Modal.Body className="modal-body">
|
|
53
|
+
|
|
54
|
+ <Box sx={{ width: '100%' }}>
|
|
55
|
+ <Stepper activeStep={activeStep}>
|
|
56
|
+ {steps.map((label, index) => {
|
|
57
|
+ const stepProps = {};
|
|
58
|
+ const labelProps = {};
|
|
59
|
+ if (isStepSkipped(index)) {
|
|
60
|
+ stepProps.completed = false;
|
|
61
|
+ }
|
|
62
|
+ return (
|
|
63
|
+ <Step key={label} {...stepProps}>
|
|
64
|
+ <StepLabel {...labelProps}>{label}</StepLabel>
|
|
65
|
+ </Step>
|
|
66
|
+ );
|
|
67
|
+ })}
|
|
68
|
+ </Stepper>
|
|
69
|
+ {activeStep === steps.length ? (
|
|
70
|
+ <React.Fragment>
|
|
71
|
+ <Typography sx={{ mt: 2, mb: 1 }}>
|
|
72
|
+ All steps completed - you're finished
|
|
73
|
+ </Typography>
|
|
74
|
+ <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
|
|
75
|
+ <Box sx={{ flex: '1 1 auto' }} />
|
|
76
|
+ <Button onClick={handleReset}>Reiniciar</Button>
|
|
77
|
+ </Box>
|
|
78
|
+ </React.Fragment>
|
|
79
|
+ ) : (
|
|
80
|
+ <React.Fragment>
|
|
81
|
+
|
|
82
|
+ <Typography sx={{ mt: 2, mb: 1 }}>
|
|
83
|
+ Paso numero: {activeStep + 1}
|
|
84
|
+ </Typography>
|
|
85
|
+
|
|
86
|
+ <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
|
|
87
|
+ <Button
|
|
88
|
+ color="inherit"
|
|
89
|
+ disabled={activeStep === 0}
|
|
90
|
+ onClick={handleBack}
|
|
91
|
+ sx={{ mr: 1 }}
|
|
92
|
+ >
|
|
93
|
+ Anterior
|
|
94
|
+ </Button>
|
|
95
|
+ <Box sx={{ flex: '1 1 auto' }} />
|
|
96
|
+ <Button onClick={handleNext}>
|
|
97
|
+ {activeStep === steps.length - 1 ? 'Guardar' : 'Siguiente'}
|
|
98
|
+ </Button>
|
|
99
|
+ </Box>
|
|
100
|
+ </React.Fragment>
|
|
101
|
+ )}
|
|
102
|
+ </Box>
|
|
103
|
+
|
|
104
|
+ </Modal.Body>
|
|
105
|
+ </Modal>
|
|
106
|
+ )
|
|
107
|
+}
|