|
|
@@ -0,0 +1,107 @@
|
|
|
+import { Modal } from 'react-bootstrap'
|
|
|
+import * as React from 'react';
|
|
|
+
|
|
|
+import {
|
|
|
+ Box, Stepper, Step,
|
|
|
+ StepLabel, Button , Typography
|
|
|
+} from '@mui/material'
|
|
|
+
|
|
|
+const steps = ['Información del candidato', 'Seleccionar plaza', 'Seleccionar pruebas', 'Confirmar'];
|
|
|
+
|
|
|
+export function HelpModal (props) {
|
|
|
+
|
|
|
+ let { visible, handleClose } = props
|
|
|
+
|
|
|
+ const [activeStep, setActiveStep] = React.useState(0);
|
|
|
+ const [skipped, setSkipped] = React.useState(new Set());
|
|
|
+
|
|
|
+ const isStepSkipped = (step) => {
|
|
|
+ return skipped.has(step);
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleNext = () => {
|
|
|
+ let newSkipped = skipped;
|
|
|
+ if (isStepSkipped(activeStep)) {
|
|
|
+ newSkipped = new Set(newSkipped.values());
|
|
|
+ newSkipped.delete(activeStep);
|
|
|
+ }
|
|
|
+
|
|
|
+ setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
|
+ setSkipped(newSkipped);
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleBack = () => {
|
|
|
+ setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleReset = () => {
|
|
|
+ setActiveStep(0);
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Modal size="lg"
|
|
|
+ aria-labelledby="contained-modal-title-vcenter"
|
|
|
+ centered show={visible}
|
|
|
+ onHide={handleClose}
|
|
|
+ >
|
|
|
+ <Modal.Header>
|
|
|
+ <button type="button" className="close" onClick={handleClose}>×</button>
|
|
|
+ <h4 className="modal-title">Crear Contraseña</h4>
|
|
|
+ </Modal.Header>
|
|
|
+ <Modal.Body className="modal-body">
|
|
|
+
|
|
|
+ <Box sx={{ width: '100%' }}>
|
|
|
+ <Stepper activeStep={activeStep}>
|
|
|
+ {steps.map((label, index) => {
|
|
|
+ const stepProps = {};
|
|
|
+ const labelProps = {};
|
|
|
+ if (isStepSkipped(index)) {
|
|
|
+ stepProps.completed = false;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <Step key={label} {...stepProps}>
|
|
|
+ <StepLabel {...labelProps}>{label}</StepLabel>
|
|
|
+ </Step>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Stepper>
|
|
|
+ {activeStep === steps.length ? (
|
|
|
+ <React.Fragment>
|
|
|
+ <Typography sx={{ mt: 2, mb: 1 }}>
|
|
|
+ All steps completed - you're finished
|
|
|
+ </Typography>
|
|
|
+ <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
|
|
|
+ <Box sx={{ flex: '1 1 auto' }} />
|
|
|
+ <Button onClick={handleReset}>Reiniciar</Button>
|
|
|
+ </Box>
|
|
|
+ </React.Fragment>
|
|
|
+ ) : (
|
|
|
+ <React.Fragment>
|
|
|
+
|
|
|
+ <Typography sx={{ mt: 2, mb: 1 }}>
|
|
|
+ Paso numero: {activeStep + 1}
|
|
|
+ </Typography>
|
|
|
+
|
|
|
+ <Box sx={{ display: 'flex', flexDirection: 'row', pt: 2 }}>
|
|
|
+ <Button
|
|
|
+ color="inherit"
|
|
|
+ disabled={activeStep === 0}
|
|
|
+ onClick={handleBack}
|
|
|
+ sx={{ mr: 1 }}
|
|
|
+ >
|
|
|
+ Anterior
|
|
|
+ </Button>
|
|
|
+ <Box sx={{ flex: '1 1 auto' }} />
|
|
|
+ <Button onClick={handleNext}>
|
|
|
+ {activeStep === steps.length - 1 ? 'Guardar' : 'Siguiente'}
|
|
|
+ </Button>
|
|
|
+ </Box>
|
|
|
+ </React.Fragment>
|
|
|
+ )}
|
|
|
+ </Box>
|
|
|
+
|
|
|
+ </Modal.Body>
|
|
|
+ </Modal>
|
|
|
+ )
|
|
|
+}
|