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