Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
training-seat-booking
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Manivasagam S
training-seat-booking
Commits
d5559c02
Commit
d5559c02
authored
Jun 18, 2025
by
Manivasagam S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code changes
parent
b0195a1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
Selectseat.jsx
src/Components/Top-level/Seatselect/Selectseat.jsx
+10
-4
Selectseat.module.css
src/Components/Top-level/Seatselect/Selectseat.module.css
+1
-0
db.json
src/db.json
+5
-3
No files found.
src/Components/Top-level/Seatselect/Selectseat.jsx
View file @
d5559c02
...
...
@@ -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
}
...
...
src/Components/Top-level/Seatselect/Selectseat.module.css
View file @
d5559c02
...
...
@@ -2,6 +2,7 @@ body {
background-color
:
#303fb6
;
margin
:
0
;
font-family
:
'Segoe UI'
;
overflow-x
:
hidden
;
}
.header
{
...
...
src/db.json
View file @
d5559c02
...
...
@@ -20,15 +20,17 @@
"phoneNumber"
:
"9361775481"
,
"name"
:
"mani"
,
"reservedSeats"
:
[
"F3"
,
"F2"
,
"F1"
,
"F8"
,
"D8"
,
"G6"
,
"E7"
,
"D5"
,
"D6"
"G2"
,
"B3"
,
"A3"
,
"D6"
,
"A4"
]
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment