iticket-seatingplan-dev 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,6 +42,7 @@ const SeatingPlan = _ref => {
|
|
|
42
42
|
const [processing, setProcessing] = (0, _react.useState)(false);
|
|
43
43
|
const [bookedSeats, setBookedSeats] = (0, _react.useState)([]);
|
|
44
44
|
const [chosenSeat, setChosenSeat] = (0, _react.useState)(null);
|
|
45
|
+
const [area, setArea] = (0, _react.useState)(null);
|
|
45
46
|
const statusColors = {
|
|
46
47
|
unknown: '#95a5a6',
|
|
47
48
|
available: '#00E640',
|
|
@@ -74,9 +75,9 @@ const SeatingPlan = _ref => {
|
|
|
74
75
|
}).then(response => {
|
|
75
76
|
if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
|
|
76
77
|
;
|
|
77
|
-
(
|
|
78
|
+
(cs || chosenSeat).circle.target.setStyle({
|
|
78
79
|
fillColor: statusColors.sold
|
|
79
|
-
})(
|
|
80
|
+
})(cs || chosenSeat).seat.s = 2;
|
|
80
81
|
const event = {
|
|
81
82
|
type: 'error',
|
|
82
83
|
details: {
|
|
@@ -90,7 +91,7 @@ const SeatingPlan = _ref => {
|
|
|
90
91
|
setProcessing(false);
|
|
91
92
|
} else if ((response === null || response === void 0 ? void 0 : response.status) === 429) {
|
|
92
93
|
;
|
|
93
|
-
(
|
|
94
|
+
(cs || chosenSeat).circle.target.setStyle({
|
|
94
95
|
fillColor: statusColors.available
|
|
95
96
|
});
|
|
96
97
|
const event = {
|
|
@@ -105,13 +106,13 @@ const SeatingPlan = _ref => {
|
|
|
105
106
|
callbackFunction(event);
|
|
106
107
|
setProcessing(false);
|
|
107
108
|
} else {
|
|
109
|
+
// console.log(chosenSeat.seat.ssId, cs?.seat.ssId)
|
|
108
110
|
s.s = 4;
|
|
109
111
|
s.bookedPrice = price;
|
|
110
|
-
(
|
|
112
|
+
(cs || chosenSeat).circle.target.setStyle({
|
|
111
113
|
fillColor: statusColors.booked
|
|
112
114
|
});
|
|
113
115
|
setProcessing(false);
|
|
114
|
-
setChosenSeat(null);
|
|
115
116
|
setBookedSeats([...bookedSeats, {
|
|
116
117
|
ssId: s.ssId,
|
|
117
118
|
r: s.r,
|
|
@@ -123,7 +124,7 @@ const SeatingPlan = _ref => {
|
|
|
123
124
|
}
|
|
124
125
|
}).catch(error => {
|
|
125
126
|
;
|
|
126
|
-
(
|
|
127
|
+
(cs || chosenSeat).circle.target.setStyle({
|
|
127
128
|
fillColor: statusColors.available
|
|
128
129
|
});
|
|
129
130
|
const event = {
|
|
@@ -142,7 +143,6 @@ const SeatingPlan = _ref => {
|
|
|
142
143
|
};
|
|
143
144
|
callbackFunction(event);
|
|
144
145
|
setProcessing(false);
|
|
145
|
-
setChosenSeat(null);
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
const removeTicketFromCart = (s, e) => {
|
|
@@ -160,7 +160,6 @@ const SeatingPlan = _ref => {
|
|
|
160
160
|
});
|
|
161
161
|
setBookedSeats(bookedSeats.filter(bs => bs.ssId !== s.ssId));
|
|
162
162
|
setProcessing(false);
|
|
163
|
-
setChosenSeat(null);
|
|
164
163
|
}).catch(error => {
|
|
165
164
|
e.target.setStyle({
|
|
166
165
|
fillColor: statusColors.booked
|
|
@@ -176,7 +175,6 @@ const SeatingPlan = _ref => {
|
|
|
176
175
|
};
|
|
177
176
|
callbackFunction(event);
|
|
178
177
|
setProcessing(false);
|
|
179
|
-
setChosenSeat(null);
|
|
180
178
|
});
|
|
181
179
|
};
|
|
182
180
|
const handleClick = (e, s) => {
|
|
@@ -258,10 +256,11 @@ const SeatingPlan = _ref => {
|
|
|
258
256
|
});
|
|
259
257
|
};
|
|
260
258
|
(0, _react.useEffect)(() => {
|
|
261
|
-
if (!
|
|
259
|
+
if (!error && areaId !== area) {
|
|
260
|
+
setArea(areaId);
|
|
262
261
|
initialFetch();
|
|
263
262
|
}
|
|
264
|
-
}, [
|
|
263
|
+
}, [areaId]);
|
|
265
264
|
(0, _react.useEffect)(() => {
|
|
266
265
|
if (bookedSeats && position && chosenSeat) {
|
|
267
266
|
const event = {
|
|
@@ -299,6 +298,69 @@ const SeatingPlan = _ref => {
|
|
|
299
298
|
height: '100%'
|
|
300
299
|
}
|
|
301
300
|
}, /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
|
|
301
|
+
position: "bottomright"
|
|
302
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
303
|
+
className: "legendBox"
|
|
304
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
305
|
+
className: "legendHeader"
|
|
306
|
+
}, "LEGEND:"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
307
|
+
style: {
|
|
308
|
+
display: 'inline-flex'
|
|
309
|
+
}
|
|
310
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
311
|
+
style: {
|
|
312
|
+
width: '1rem',
|
|
313
|
+
height: '1rem',
|
|
314
|
+
borderRadius: '100%',
|
|
315
|
+
background: '#00E640'
|
|
316
|
+
}
|
|
317
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
318
|
+
style: {
|
|
319
|
+
margin: '0 0.5rem'
|
|
320
|
+
}
|
|
321
|
+
}, "available"))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
322
|
+
style: {
|
|
323
|
+
display: 'inline-flex'
|
|
324
|
+
}
|
|
325
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
326
|
+
style: {
|
|
327
|
+
width: '1rem',
|
|
328
|
+
height: '1rem',
|
|
329
|
+
borderRadius: '100%',
|
|
330
|
+
background: '#95a5a6'
|
|
331
|
+
}
|
|
332
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
333
|
+
style: {
|
|
334
|
+
margin: '0 0.5rem'
|
|
335
|
+
}
|
|
336
|
+
}, "sold"))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
337
|
+
style: {
|
|
338
|
+
display: 'inline-flex'
|
|
339
|
+
}
|
|
340
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
341
|
+
style: {
|
|
342
|
+
width: '1rem',
|
|
343
|
+
height: '1rem',
|
|
344
|
+
borderRadius: '100%',
|
|
345
|
+
background: '#e74c3c'
|
|
346
|
+
}
|
|
347
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
348
|
+
style: {
|
|
349
|
+
margin: '0 0.5rem'
|
|
350
|
+
}
|
|
351
|
+
}, "in cart"))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
352
|
+
style: {
|
|
353
|
+
display: 'inline-flex'
|
|
354
|
+
}
|
|
355
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
356
|
+
src: wheelchairSeat,
|
|
357
|
+
width: 15,
|
|
358
|
+
height: 15
|
|
359
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
360
|
+
style: {
|
|
361
|
+
margin: '0 0.5rem'
|
|
362
|
+
}
|
|
363
|
+
}, "wheelchair"))))), /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
|
|
302
364
|
position: "topleft"
|
|
303
365
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
304
366
|
style: {
|
|
@@ -7,6 +7,20 @@
|
|
|
7
7
|
-moz-osx-font-smoothing: grayscale;
|
|
8
8
|
} */
|
|
9
9
|
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.legendBox {
|
|
13
|
+
background: rgba(0, 0, 0, 0.03);
|
|
14
|
+
padding: 0.5rem 1rem;
|
|
15
|
+
border-radius: 3px;
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.legendHeader {
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
10
24
|
.rotate {
|
|
11
25
|
animation: rotation 2s infinite linear;
|
|
12
26
|
}
|