Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
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
Syed Abdul Rahman
seat-booking
Commits
1ebb4626
Commit
1ebb4626
authored
Jun 11, 2025
by
Syed Abdul Rahman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Impemented remove seats in json-server
parent
33d00106
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
100 deletions
+70
-100
db.json
db.json
+12
-64
Index.jsx
src/components/Layout/BookingWrapper/Index.jsx
+0
-1
styles.module.css
src/components/Layout/BookingWrapper/styles.module.css
+1
-6
Index.jsx
src/components/Shared/Modal/Index.jsx
+44
-22
styles.module.css
src/components/Shared/Modal/styles.module.css
+5
-2
Index.jsx
src/components/TopLevel/SeatBooking/Index.jsx
+0
-0
styles.module.css
src/components/TopLevel/SeatBooking/styles.module.css
+4
-4
AppConstants.js
src/utils/AppConstants.js
+4
-1
No files found.
db.json
View file @
1ebb4626
...
...
@@ -23,74 +23,21 @@
{
"id"
:
"a6af"
,
"email"
:
"testing@gmail.com"
},
{
"id"
:
"7fdf"
,
"email"
:
"test@gmail.com"
},
{
"id"
:
"a9b6"
,
"email"
:
"new@gmail.com"
}
],
"selectedSeats"
:
[
{
"id"
:
"a6af"
,
"userid"
:
"a6af"
,
"selected"
:
[
{
"row"
:
8
,
"seat"
:
2
},
{
"row"
:
8
,
"seat"
:
3
},
{
"row"
:
8
,
"seat"
:
4
},
{
"row"
:
8
,
"seat"
:
4
},
{
"row"
:
8
,
"seat"
:
3
},
{
"row"
:
8
,
"seat"
:
2
},
{
"row"
:
8
,
"seat"
:
4
},
{
"row"
:
8
,
"seat"
:
3
},
{
"row"
:
8
,
"seat"
:
2
},
{
"row"
:
8
,
"seat"
:
3
},
{
"row"
:
8
,
"seat"
:
4
},
{
"row"
:
8
,
"seat"
:
2
},
{
"row"
:
8
,
"seat"
:
2
},
{
"row"
:
8
,
"seat"
:
3
},
{
"row"
:
8
,
"seat"
:
4
}
]
"id"
:
"1ad9"
,
"userid"
:
"1ad9"
,
"selected"
:
[]
}
]
}
\ No newline at end of file
src/components/Layout/BookingWrapper/Index.jsx
View file @
1ebb4626
...
...
@@ -61,7 +61,6 @@ const BookingWrapper = ({ onSeatClick, selectedSeats, seatData, currentSeats })
seatClass
+=
selectedBy
==
currentUser
?
'selected-by-me'
:
'selected-by-other'
;
}
console
.
log
(
seatClass
,
"SeatCLaskk"
)
return
(
<
Seat
status=
{
seatClass
}
id=
{
column
.
id
}
onClick=
{
()
=>
onSeatClick
(
row
.
row_id
,
column
.
id
)
}
/>
)
...
...
src/components/Layout/BookingWrapper/styles.module.css
View file @
1ebb4626
...
...
@@ -6,8 +6,6 @@
cursor
:
pointer
;
}
.seat
:hover
{
background-color
:
aqua
;
}
...
...
@@ -22,7 +20,6 @@
background-color
:
aqua
;
}
.theatre
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -59,6 +56,7 @@
.selected-by-other
{
background-color
:
#bec0c26
d
!important
;
pointer-events
:
none
;
}
.booking-wrapper
{
...
...
@@ -66,8 +64,6 @@
overflow
:
auto
;
}
@media
screen
and
(
min-width
:
768px
)
{
.seat
{
...
...
@@ -84,7 +80,6 @@
height
:
2em
;
}
.seat-row
{
gap
:
15px
;
}
...
...
src/components/Shared/Modal/Index.jsx
View file @
1ebb4626
import
Input
from
'../../Base/Input/Index'
;
import
Button
from
'../../Base/Button/Index'
import
styles
from
'./styles.module.css'
;
import
Input
from
"../../Base/Input/Index"
;
import
Button
from
"../../Base/Button/Index"
;
import
styles
from
"./styles.module.css"
;
const
Modal
=
({
onConfirm
,
onChange
})
=>
{
return
(
<
div
className=
{
styles
[
"overlay-container"
]
}
>
<
div
className=
{
styles
[
'modal-dialog'
]
}
role=
"dialog"
aria
-
modal=
"true"
>
<
h2
className=
{
styles
[
'modal-title'
]
}
>
Select Your Seats
</
h2
>
const
Modal
=
({
onConfirm
,
onChange
,
variant
,
onOfSeats
})
=>
{
return
(
<
div
className=
{
styles
[
"overlay-container"
]
}
>
<
div
className=
{
styles
[
"modal-dialog"
]
}
role=
"dialog"
aria
-
modal=
"true"
>
{
variant
==
"input"
&&
(
<>
<
h2
className=
{
styles
[
"modal-title"
]
}
>
Select Your Seats
</
h2
>
<
p
>
Please choose how many seats you'd like to book.
</
p
>
<
Input
label=
{
"Number of Seats"
}
placeholder=
'Enter number of seats'
type=
'number'
max=
'10'
min=
'1'
onChange=
{
(
e
)
=>
onChange
(
e
.
target
.
value
)
}
label=
{
"Number of Seats"
}
placeholder=
"Enter number of seats"
type=
"number"
max=
"10"
min=
"1"
onChange=
{
(
e
)
=>
onChange
(
e
.
target
.
value
)
}
/>
<
div
className=
{
styles
[
'btn-wrapper'
]
}
>
<
Button
size=
{
'sm'
}
onClick=
{
onConfirm
}
>
Confirm
</
Button
>
<
div
className=
{
`${styles["btn-wrapper"]} ${styles["flex-direction"]}`
}
>
<
Button
size=
{
"sm"
}
onClick=
{
onConfirm
}
>
Confirm
</
Button
>
</
div
>
</>
)
}
{
variant
==
"confirm"
&&
(
<>
<
h2
className=
{
styles
[
"modal-title"
]
}
>
Confirm Your Selection
</
h2
>
<
p
>
You have selected
<
strong
>
{
onOfSeats
}
</
strong
>
seat
{
onOfSeats
!==
1
?
"s"
:
""
}
.
</
p
>
<
p
>
Please confirm to proceed with your booking.
</
p
>
<
div
className=
{
styles
[
"btn-wrapper"
]
}
>
<
Button
size=
{
"sm"
}
onClick=
{
onConfirm
}
>
Cancel
</
Button
>
<
Button
size=
{
"sm"
}
onClick=
{
onConfirm
}
>
Confirm
</
Button
>
</
div
>
</
div
>
</>
)
}
</
div
>
)
}
</
div
>
);
};
export
default
Modal
;
\ No newline at end of file
export
default
Modal
;
src/components/Shared/Modal/styles.module.css
View file @
1ebb4626
...
...
@@ -23,10 +23,13 @@
.btn-wrapper
{
display
:
flex
;
/* justify-content: flex-end; */
flex-direction
:
column
;
justify-content
:
flex-end
;
gap
:
1rem
;
margin
:
1rem
0
;
}
.flex-direction
{
flex-direction
:
column
;
}
.modal-title
{
font-family
:
'Poppins-Medium'
;
...
...
src/components/TopLevel/SeatBooking/Index.jsx
View file @
1ebb4626
This diff is collapsed.
Click to expand it.
src/components/TopLevel/SeatBooking/styles.module.css
View file @
1ebb4626
...
...
@@ -8,11 +8,11 @@
padding-bottom
:
65px
;
display
:
flex
;
}
.seat-booking-wrapper
>
div
{
flex
:
1
;
}
.btn-wrapper
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -20,11 +20,10 @@
flex
:
1
;
padding
:
1.5rem
0
;
}
.logout
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;
cursor
:
pointer
;
}
}
\ No newline at end of file
src/utils/AppConstants.js
View file @
1ebb4626
export
const
appConstants
=
{
API_URL_SEATS
:
"http://localhost:3000/selectedSeats"
,
API_URL_USERS
:
"http://localhost:3000/users"
API_URL_USERS
:
"http://localhost:3000/users"
,
USER
:
"user"
,
MODAL
:
"modal"
}
// 192.168.1.121
\ No newline at end of file
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