Commit d5559c02 by Manivasagam S

code changes

parent b0195a1b
......@@ -44,7 +44,7 @@ export const Selectseat = ({ onLogout }) => {
setAvailableSeats(available);
if (currentUser?.name && !hasWelcomed.current) {
toast.success(`Welcome, ${currentUser.name}`);
toast.success(`Welcome😊, ${currentUser.name}`);
hasWelcomed.current = true;
}
})
......@@ -61,11 +61,16 @@ export const Selectseat = ({ onLogout }) => {
toast.warn("User not logged in");
return;
}
const unselectedReserved = selectedData.filter(seat => !selectedSeats.includes(seat));
const newlySelected = selectedSeats.filter(s => !selectedData.includes(s));
if (unselectedReserved.length > 0 && newlySelected.length < unselectedReserved.length) {
toast.error(`You unselected ${unselectedReserved.length} reserved seat(s), so you must select ${unselectedReserved.length} new seat(s).`);
return;
}
if (newlySelected.length < seatCount - selectedData.length) {
toast.error(`You must select exactly ${seatCount - selectedData.length} new seats`);
hasWelcomed.current = true;
return;
}
......@@ -87,6 +92,7 @@ export const Selectseat = ({ onLogout }) => {
if (conflictSeats.length > 0) {
toast.error(`The following seats were just taken: ${conflictSeats.join(", ")}`);
hasWelcomed.current = true;
return;
}
......@@ -153,7 +159,7 @@ export const Selectseat = ({ onLogout }) => {
<Modal
title={
selectedData.length > 0
? `You have already booked ${selectedData.length} seat(s). Add more?`
? `You have already booked ${selectedData.length} seat(s) Add more?`
: "Choose Number of Seats"
}
availableSeats={availableSeats}
......
......@@ -2,6 +2,7 @@ body {
background-color: #303fb6;
margin: 0;
font-family: 'Segoe UI';
overflow-x: hidden;
}
.header {
......
......@@ -20,15 +20,17 @@
"phoneNumber": "9361775481",
"name": "mani",
"reservedSeats": [
"F3",
"F2",
"F1",
"F8",
"D8",
"G6",
"E7",
"D5",
"D6"
"G2",
"B3",
"A3",
"D6",
"A4"
]
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment