1
- import React , { Component } from "react" ;
1
+ import React from "react" ;
2
2
import {
3
3
Movies as MovieData ,
4
4
Slots as SlotData ,
@@ -33,14 +33,6 @@ export default class DataContextProvider extends React.Component {
33
33
this . slots = new SlotData ( ) ;
34
34
}
35
35
36
- backToPhase2 = ( ) => {
37
- console . log ( "2" ) ;
38
- } ;
39
-
40
- backToPhase1 = ( ) => {
41
- console . log ( "1" ) ;
42
- } ;
43
-
44
36
addPopcorn = ( popcorn ) => {
45
37
this . setState ( { popcorn } ) ;
46
38
} ;
@@ -52,10 +44,12 @@ export default class DataContextProvider extends React.Component {
52
44
53
45
dataChange4 = ( popcorn ) => {
54
46
let { slotSelect, seatSelect} = this . state
55
- this . slots . modifySlotsAddBookedSeats ( slotSelect , seatSelect )
56
- this . setState ( { popcorn, phase : 4 , bookingID : uuidv4 ( ) } , ( ) =>
57
- console . log ( this . state )
58
- ) ;
47
+ this . slots . modifySlotsAddBookedSeats ( slotSelect , seatSelect )
48
+ this . setState ( {
49
+ popcorn,
50
+ phase : 4 ,
51
+ bookingID : uuidv4 ( )
52
+ } ) ;
59
53
} ;
60
54
61
55
dataChange3 = ( seatSelect ) => {
@@ -64,9 +58,11 @@ export default class DataContextProvider extends React.Component {
64
58
65
59
dataChange2 = ( slotSelect ) => {
66
60
let slotDetails = this . slots . getSlotsByID ( Number ( slotSelect ) ) ;
67
- this . setState ( { slotSelect, phase : 2 , slotDetails } , ( ) =>
68
- console . log ( this . state )
69
- ) ;
61
+ this . setState ( {
62
+ slotSelect,
63
+ phase : 2 ,
64
+ slotDetails
65
+ } ) ;
70
66
} ;
71
67
72
68
dataChange1 = ( movieSelect ) => {
@@ -79,10 +75,12 @@ export default class DataContextProvider extends React.Component {
79
75
this . state . location ,
80
76
movieSelect
81
77
) ;
82
- console . log ( dateSelect , slotDisplay ) ;
83
- this . setState ( { phase : 1 , movieSelect, dateSelect, slotDisplay } , ( ) =>
84
- console . log ( this . state )
85
- ) ;
78
+ this . setState ( {
79
+ phase : 1 ,
80
+ movieSelect,
81
+ dateSelect,
82
+ slotDisplay
83
+ } ) ;
86
84
} ;
87
85
88
86
setPhase0 = ( ) => {
@@ -154,7 +152,7 @@ export default class DataContextProvider extends React.Component {
154
152
this . setState ( { dateSelect, slotDisplay } ) ;
155
153
} ;
156
154
157
- getSlots = ( date ) => {
155
+ getSlots = ( ) => {
158
156
let slotDisplay = this . slots . getAllSlotsBasedOnDateLocationMovie (
159
157
this . state . dateSelect ,
160
158
this . state . location ,
@@ -164,7 +162,6 @@ export default class DataContextProvider extends React.Component {
164
162
} ;
165
163
166
164
returnFilter = ( ) => {
167
- console . log ( "here" ) ;
168
165
let filter = this . state . filterMovies . trim ( ) . toLowerCase ( ) ;
169
166
if ( filter . length > 0 ) {
170
167
return this . state . movies . filter ( ( x ) =>
@@ -198,10 +195,7 @@ export default class DataContextProvider extends React.Component {
198
195
setPhase0 : this . setPhase0 ,
199
196
setPhase1 : this . setPhase1 ,
200
197
setPhase2 : this . setPhase2 ,
201
- setPhase3 : this . setPhase3 ,
202
198
addPopcorn : this . addPopcorn ,
203
- backToPhase1 : this . backToPhase1 ,
204
- backToPhase2 : this . backToPhase2 ,
205
199
setLocation : this . setLocation ,
206
200
locationChange : this . locationChange ,
207
201
} ;
0 commit comments