amenpunk il y a 3 ans
Parent
commit
864fb8b28a

+ 6 - 1
src/Components/Modal/PasswordModal.jsx

@@ -9,6 +9,7 @@ import {
9 9
 import { StepOne } from '../Password/Steps/one'
10 10
 import { StepTwo } from '../Password/Steps/two'
11 11
 import { StepTree } from '../Password/Steps/tree'
12
+import { StepFour } from '../Password/Steps/four'
12 13
 
13 14
 export function HelpModal (props) {
14 15
 
@@ -68,7 +69,11 @@ export function HelpModal (props) {
68 69
         },
69 70
         {
70 71
             label : 'Confirmar',
71
-            operation: <h1>adios</h1>
72
+            operation: 
73
+                <StepFour
74
+                    handleNext={handleNext} 
75
+                    handleBack={handleBack} 
76
+                />
72 77
         },
73 78
     ];
74 79
 

+ 116 - 0
src/Components/Password/Steps/four.js

@@ -0,0 +1,116 @@
1
+import * as Yup from 'yup';
2
+// import { useState, useEffect } from 'react';
3
+import { useFormik, Form, FormikProvider } from 'formik';
4
+
5
+import {
6
+    Box, Button, Stack, Checkbox,
7
+    TextField, Autocomplete,
8
+} from '@mui/material';
9
+
10
+
11
+export function StepFour(props) {
12
+
13
+
14
+    const PlazaScheme = Yup.object().shape({
15
+        puesto: Yup.object().required('Escoge un puesto valido')
16
+    });
17
+
18
+    let {  handleNext, handleBack } = props
19
+
20
+    const formik = useFormik({
21
+        initialValues: {
22
+            puesto: {}
23
+        },
24
+        onSubmit: (fields) => {
25
+            console.log('SUBMIT > ',fields)
26
+            handleNext()
27
+        },
28
+        validationSchema: PlazaScheme,
29
+    });
30
+
31
+    const {errors, touched, handleSubmit, getFieldProps, setValues } = formik;
32
+
33
+    return (
34
+        <FormikProvider style={{ padding : 25 }} value={formik}>
35
+            <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
36
+                <Stack spacing={2}>
37
+
38
+
39
+                    <Box
40
+                        component="form"
41
+                        sx={{
42
+                            '& .MuiTextField-root': { m: 1, width: '25ch' },
43
+                        }}
44
+                        noValidate
45
+                        autoComplete="off"
46
+                    >
47
+                        <div>
48
+                            <TextField
49
+                                required
50
+                                id="outlined-required"
51
+                                label="Required"
52
+                                defaultValue="Hello World"
53
+                                />
54
+                            <TextField
55
+                                disabled
56
+                                id="outlined-disabled"
57
+                                label="Disabled"
58
+                                defaultValue="Hello World"
59
+                                />
60
+                            <TextField
61
+                                id="outlined-password-input"
62
+                                label="Password"
63
+                                type="password"
64
+                                autoComplete="current-password"
65
+                                />
66
+                            <TextField
67
+                                id="outlined-read-only-input"
68
+                                label="Read Only"
69
+                                defaultValue="Hello World"
70
+                                InputProps={{
71
+                                    readOnly: true,
72
+                                }}
73
+                                />
74
+                            <TextField
75
+                                id="outlined-number"
76
+                                label="Number"
77
+                                type="number"
78
+                                InputLabelProps={{
79
+                                    shrink: true,
80
+                                }}
81
+                                />
82
+                            <TextField id="outlined-search" label="Search field" type="search" />
83
+                            <TextField
84
+                                id="outlined-helperText"
85
+                                label="Helper text"
86
+                                defaultValue="Default Value"
87
+                                helperText="Some important text"
88
+                                />
89
+                        </div>
90
+                    </Box>
91
+
92
+                    <Box sx={{ mb: 2 }}>
93
+                        <div style={{ paddingTop  : 15}}>
94
+                            <Button
95
+                                type="submit"
96
+                                className="registerBtn" 
97
+                                variant="contained"
98
+                                sx={{ mt: 1, mr: 1 }}
99
+                            >
100
+                                {'Siguiente'}
101
+                            </Button>
102
+                            <Button
103
+                                disabled={false}
104
+                                onClick={handleBack}
105
+                                sx={{ mt: 1, mr: 1 }}
106
+                            >
107
+                                Regresar
108
+                            </Button>
109
+                        </div>
110
+                    </Box>
111
+
112
+                </Stack>
113
+            </Form>
114
+        </FormikProvider>
115
+    );
116
+}

+ 115 - 24
src/Components/Password/Steps/tree.js

@@ -1,29 +1,120 @@
1
+import React from 'react'
2
+import * as Yup from 'yup';
3
+// import { useState, useEffect } from 'react';
4
+import { useFormik, Form, FormikProvider } from 'formik';
5
+
1 6
 import {
2
-    Box, Button, Stack,
3
-    TextField, Autocomplete
7
+    Box, Button, Stack, Checkbox,
8
+    TextField, Autocomplete,
4 9
 } from '@mui/material';
5 10
 
11
+import {
12
+    CheckBox as CheckBoxIcon,
13
+    CheckBoxOutlineBlank as CheckBoxOutlineBlankIcon
14
+} from '@mui/icons-material';
15
+
16
+const icon = <CheckBoxOutlineBlankIcon fontSize="small" />;
17
+const checkedIcon = <CheckBoxIcon fontSize="small" />;
18
+
6 19
 export function StepTree(props) {
7
-    return(
8
-        <Box sx={{ mb: 2 }}>
9
-            <div style={{ paddingTop  : 15}}>
10
-                <Button
11
-                    type="submit"
12
-                    className="registerBtn" 
13
-                    variant="contained"
14
-                    sx={{ mt: 1, mr: 1 }}
15
-                >
16
-                    {'Siguiente'}
17
-                </Button>
18
-                <Button
19
-                    disabled={false}
20
-                    onClick={props.handleBack}
21
-                    sx={{ mt: 1, mr: 1 }}
22
-                >
23
-                    Regresar
24
-                </Button>
25
-            </div>
26
-        </Box>
27
-
28
-    )
20
+
21
+    const PlazaScheme = Yup.object().shape({
22
+        puesto: Yup.object().required('Escoge un puesto valido')
23
+    });
24
+
25
+    let {  handleNext, handleBack } = props
26
+
27
+    const formik = useFormik({
28
+        initialValues: {
29
+            puesto: {}
30
+        },
31
+        onSubmit: (fields) => {
32
+            console.log('SUBMIT > ',fields)
33
+            handleNext()
34
+        },
35
+        validationSchema: PlazaScheme,
36
+    });
37
+
38
+    const {errors, touched, handleSubmit, getFieldProps, setValues } = formik;
39
+
40
+    return (
41
+        <FormikProvider style={{ padding : 25 }} value={formik}>
42
+            <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
43
+                <Stack spacing={2}>
44
+
45
+                    <Autocomplete
46
+                        multiple
47
+                        id="checkboxes-tags-demo"
48
+                        options={top100Films}
49
+                        disableCloseOnSelect
50
+                        getOptionLabel={(option) => option.label}
51
+                        onChange={(a,b,c) => {
52
+                            setValues({
53
+                                puesto : b[0]
54
+                            })
55
+                        }}
56
+                        renderOption={(props, option, { selected }) => (
57
+                            <li {...props}>
58
+                                <Checkbox
59
+                                    icon={icon}
60
+                                    checkedIcon={checkedIcon}
61
+                                    // style={{ marginRight: 8 }}
62
+                                    checked={selected}
63
+                                    />
64
+                                {option.label}
65
+                            </li>
66
+                        )}
67
+                        renderInput={(params) => (
68
+                            <TextField 
69
+                                {...getFieldProps('puesto')}
70
+                                error={Boolean(touched.puesto && errors.puesto)}
71
+                                helperText={touched.puesto && errors.puesto}
72
+                                {...params} 
73
+                                label="Escribe el nombre de la prueba" 
74
+                                placeholder="Prueba" 
75
+                            />
76
+                        )}
77
+                    />
78
+
79
+                    <Box sx={{ mb: 2 }}>
80
+                        <div style={{ paddingTop  : 15}}>
81
+                            <Button
82
+                                type="submit"
83
+                                className="registerBtn" 
84
+                                variant="contained"
85
+                                sx={{ mt: 1, mr: 1 }}
86
+                            >
87
+                                {'Siguiente'}
88
+                            </Button>
89
+                            <Button
90
+                                disabled={false}
91
+                                onClick={handleBack}
92
+                                sx={{ mt: 1, mr: 1 }}
93
+                            >
94
+                                Regresar
95
+                            </Button>
96
+                        </div>
97
+                    </Box>
98
+
99
+                </Stack>
100
+            </Form>
101
+        </FormikProvider>
102
+    );
29 103
 }
104
+const top100Films = [
105
+    { label: 'City of God', year: 2002 },
106
+    { label: 'Se7en', year: 1995 },
107
+    { label: 'The Silence of the Lambs', year: 1991 },
108
+    { label: "It's a Wonderful Life", year: 1946 },
109
+    { label: 'Life Is Beautiful', year: 1997 },
110
+    { label: 'The Usual Suspects', year: 1995 },
111
+    { label: 'Grave of the Fireflies', year: 1988 },
112
+    { label: 'Paths of Glory', year: 1957 },
113
+    { label: 'Django Unchained', year: 2012 },
114
+    { label: 'The Shining', year: 1980 },
115
+    { label: 'WALL·E', year: 2008 },
116
+    { label: 'American Beauty', year: 1999 },
117
+    { label: 'The Dark Knight Rises', year: 2012 },
118
+];
119
+
120
+

+ 21 - 146
src/Components/Password/Steps/two.js

@@ -5,7 +5,7 @@ import { useFormik, Form, FormikProvider } from 'formik';
5 5
 
6 6
 import {
7 7
     Box, Button, Stack, Checkbox,
8
-    TextField, Autocomplete,
8
+    TextField, Autocomplete,Select,FormControl,MenuItem,InputLabel
9 9
 } from '@mui/material';
10 10
 
11 11
 import {
@@ -35,6 +35,12 @@ export function StepTwo(props) {
35 35
         validationSchema: PlazaScheme,
36 36
     });
37 37
 
38
+    const [age, setAge] = React.useState('');
39
+
40
+    const handleChange = (event) => {
41
+        setAge(event.target.value);
42
+    };
43
+
38 44
     const {errors, touched, handleSubmit, getFieldProps, setValues } = formik;
39 45
 
40 46
     return (
@@ -42,38 +48,20 @@ export function StepTwo(props) {
42 48
             <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
43 49
                 <Stack spacing={2}>
44 50
 
45
-                    <Autocomplete
46
-                        multiple
47
-                        id="checkboxes-tags-demo"
48
-                        options={top100Films}
49
-                        disableCloseOnSelect
50
-                        getOptionLabel={(option) => option.label}
51
-                        onChange={(a,b,c) => {
52
-                            setValues({
53
-                                puesto : b[0]
54
-                            })
55
-                        }}
56
-                        renderOption={(props, option, { selected }) => (
57
-                            <li {...props}>
58
-                                <Checkbox
59
-                                    icon={icon}
60
-                                    checkedIcon={checkedIcon}
61
-                                    // style={{ marginRight: 8 }}
62
-                                    checked={selected}
63
-                                    />
64
-                                {option.label}
65
-                            </li>
66
-                        )}
67
-                        renderInput={(params) => (
68
-                            <TextField 
69
-                                {...getFieldProps('puesto')}
70
-                                error={Boolean(touched.puesto && errors.puesto)}
71
-                                helperText={touched.puesto && errors.puesto}
72
-                                {...params} 
73
-                                label="Checkboxes" placeholder="Favorites" 
74
-                                />
75
-                        )}
76
-                    />
51
+                    <FormControl fullWidth>
52
+                        <InputLabel id="demo-simple-select-label">Puestos</InputLabel>
53
+                        <Select
54
+                            labelId="demo-simple-select-label"
55
+                            id="demo-simple-select"
56
+                            value={age}
57
+                            label="Puestos"
58
+                            onChange={handleChange}
59
+                        >
60
+                            <MenuItem value={10}>Ten</MenuItem>
61
+                            <MenuItem value={20}>Twenty</MenuItem>
62
+                            <MenuItem value={30}>Thirty</MenuItem>
63
+                        </Select>
64
+                    </FormControl>
77 65
 
78 66
                     <Box sx={{ mb: 2 }}>
79 67
                         <div style={{ paddingTop  : 15}}>
@@ -101,80 +89,12 @@ export function StepTwo(props) {
101 89
     );
102 90
 }
103 91
 const top100Films = [
104
-    { label: 'The Shawshank Redemption', year: 1994 },
105
-    { label: 'The Godfather', year: 1972 },
106
-    { label: 'The Godfather: Part II', year: 1974 },
107
-    { label: 'The Dark Knight', year: 2008 },
108
-    { label: '12 Angry Men', year: 1957 },
109
-    { label: "Schindler's List", year: 1993 },
110
-    { label: 'Pulp Fiction', year: 1994 },
111
-    {
112
-        label: 'The Lord of the Rings: The Return of the King',
113
-        year: 2003,
114
-    },
115
-    { label: 'The Good, the Bad and the Ugly', year: 1966 },
116
-    { label: 'Fight Club', year: 1999 },
117
-    {
118
-        label: 'The Lord of the Rings: The Fellowship of the Ring',
119
-        year: 2001,
120
-    },
121
-    {
122
-        label: 'Star Wars: Episode V - The Empire Strikes Back',
123
-        year: 1980,
124
-    },
125
-    { label: 'Forrest Gump', year: 1994 },
126
-    { label: 'Inception', year: 2010 },
127
-    {
128
-        label: 'The Lord of the Rings: The Two Towers',
129
-        year: 2002,
130
-    },
131
-    { label: "One Flew Over the Cuckoo's Nest", year: 1975 },
132
-    { label: 'Goodfellas', year: 1990 },
133
-    { label: 'The Matrix', year: 1999 },
134
-    { label: 'Seven Samurai', year: 1954 },
135
-    {
136
-        label: 'Star Wars: Episode IV - A New Hope',
137
-        year: 1977,
138
-    },
139 92
     { label: 'City of God', year: 2002 },
140 93
     { label: 'Se7en', year: 1995 },
141 94
     { label: 'The Silence of the Lambs', year: 1991 },
142 95
     { label: "It's a Wonderful Life", year: 1946 },
143 96
     { label: 'Life Is Beautiful', year: 1997 },
144 97
     { label: 'The Usual Suspects', year: 1995 },
145
-    { label: 'Léon: The Professional', year: 1994 },
146
-    { label: 'Spirited Away', year: 2001 },
147
-    { label: 'Saving Private Ryan', year: 1998 },
148
-    { label: 'Once Upon a Time in the West', year: 1968 },
149
-    { label: 'American History X', year: 1998 },
150
-    { label: 'Interstellar', year: 2014 },
151
-    { label: 'Casablanca', year: 1942 },
152
-    { label: 'City Lights', year: 1931 },
153
-    { label: 'Psycho', year: 1960 },
154
-    { label: 'The Green Mile', year: 1999 },
155
-    { label: 'The Intouchables', year: 2011 },
156
-    { label: 'Modern Times', year: 1936 },
157
-    { label: 'Raiders of the Lost Ark', year: 1981 },
158
-    { label: 'Rear Window', year: 1954 },
159
-    { label: 'The Pianist', year: 2002 },
160
-    { label: 'The Departed', year: 2006 },
161
-    { label: 'Terminator 2: Judgment Day', year: 1991 },
162
-    { label: 'Back to the Future', year: 1985 },
163
-    { label: 'Whiplash', year: 2014 },
164
-    { label: 'Gladiator', year: 2000 },
165
-    { label: 'Memento', year: 2000 },
166
-    { label: 'The Prestige', year: 2006 },
167
-    { label: 'The Lion King', year: 1994 },
168
-    { label: 'Apocalypse Now', year: 1979 },
169
-    { label: 'Alien', year: 1979 },
170
-    { label: 'Sunset Boulevard', year: 1950 },
171
-    {
172
-        label: 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb',
173
-        year: 1964,
174
-    },
175
-    { label: 'The Great Dictator', year: 1940 },
176
-    { label: 'Cinema Paradiso', year: 1988 },
177
-    { label: 'The Lives of Others', year: 2006 },
178 98
     { label: 'Grave of the Fireflies', year: 1988 },
179 99
     { label: 'Paths of Glory', year: 1957 },
180 100
     { label: 'Django Unchained', year: 2012 },
@@ -182,49 +102,4 @@ const top100Films = [
182 102
     { label: 'WALL·E', year: 2008 },
183 103
     { label: 'American Beauty', year: 1999 },
184 104
     { label: 'The Dark Knight Rises', year: 2012 },
185
-    { label: 'Princess Mononoke', year: 1997 },
186
-    { label: 'Aliens', year: 1986 },
187
-    { label: 'Oldboy', year: 2003 },
188
-    { label: 'Once Upon a Time in America', year: 1984 },
189
-    { label: 'Witness for the Prosecution', year: 1957 },
190
-    { label: 'Das Boot', year: 1981 },
191
-    { label: 'Citizen Kane', year: 1941 },
192
-    { label: 'North by Northwest', year: 1959 },
193
-    { label: 'Vertigo', year: 1958 },
194
-    {
195
-        label: 'Star Wars: Episode VI - Return of the Jedi',
196
-        year: 1983,
197
-    },
198
-    { label: 'Reservoir Dogs', year: 1992 },
199
-    { label: 'Braveheart', year: 1995 },
200
-    { label: 'M', year: 1931 },
201
-    { label: 'Requiem for a Dream', year: 2000 },
202
-    { label: 'Amélie', year: 2001 },
203
-    { label: 'A Clockwork Orange', year: 1971 },
204
-    { label: 'Like Stars on Earth', year: 2007 },
205
-    { label: 'Taxi Driver', year: 1976 },
206
-    { label: 'Lawrence of Arabia', year: 1962 },
207
-    { label: 'Double Indemnity', year: 1944 },
208
-    {
209
-        label: 'Eternal Sunshine of the Spotless Mind',
210
-        year: 2004,
211
-    },
212
-    { label: 'Amadeus', year: 1984 },
213
-    { label: 'To Kill a Mockingbird', year: 1962 },
214
-    { label: 'Toy Story 3', year: 2010 },
215
-    { label: 'Logan', year: 2017 },
216
-    { label: 'Full Metal Jacket', year: 1987 },
217
-    { label: 'Dangal', year: 2016 },
218
-    { label: 'The Sting', year: 1973 },
219
-    { label: '2001: A Space Odyssey', year: 1968 },
220
-    { label: "Singin' in the Rain", year: 1952 },
221
-    { label: 'Toy Story', year: 1995 },
222
-    { label: 'Bicycle Thieves', year: 1948 },
223
-    { label: 'The Kid', year: 1921 },
224
-    { label: 'Inglourious Basterds', year: 2009 },
225
-    { label: 'Snatch', year: 2000 },
226
-    { label: '3 Idiots', year: 2009 },
227
-    { label: 'Monty Python and the Holy Grail', year: 1975 },
228 105
 ];
229
-
230
-