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
c8aa424e
Commit
c8aa424e
authored
Jun 19, 2025
by
Syed Abdul Rahman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented alias component import
parent
046265a1
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
87 additions
and
79 deletions
+87
-79
db.json
db.json
+19
-4
jsconfig.json
jsconfig.json
+9
-0
Index.jsx
src/components/Layout/BookingWrapper/Index.jsx
+12
-2
styles.module.css
src/components/Layout/BookingWrapper/styles.module.css
+6
-0
styles.module.css
src/components/Layout/Header/styles.module.css
+1
-0
LogoutButton.stories.jsx
src/components/Shared/LogoutButton/LogoutButton.stories.jsx
+1
-1
styles.module.css
src/components/TopLevel/LegendWrapper/styles.module.css
+2
-2
styles.module.css
src/components/TopLevel/Login/styles.module.css
+0
-1
Index.jsx
src/components/TopLevel/SeatSelectionContent/Index.jsx
+1
-1
index.css
src/index.css
+5
-3
Index.jsx
src/pages/BookingPage/Index.jsx
+20
-33
styles.module.css
src/pages/BookingPage/styles.module.css
+0
-27
Index.jsx
src/pages/LoginPage/Index.jsx
+1
-1
styles.module.css
src/pages/LoginPage/styles.module.css
+0
-0
vite.config.js
vite.config.js
+10
-4
No files found.
db.json
View file @
c8aa424e
...
@@ -67,19 +67,19 @@
...
@@ -67,19 +67,19 @@
"userid"
:
"42f0"
,
"userid"
:
"42f0"
,
"selected"
:
[
"selected"
:
[
{
{
"row"
:
7
,
"row"
:
6
,
"seat"
:
1
"seat"
:
1
},
},
{
{
"row"
:
7
,
"row"
:
6
,
"seat"
:
2
"seat"
:
2
},
},
{
{
"row"
:
7
,
"row"
:
6
,
"seat"
:
3
"seat"
:
3
},
},
{
{
"row"
:
7
,
"row"
:
6
,
"seat"
:
4
"seat"
:
4
}
}
]
]
...
@@ -119,6 +119,20 @@
...
@@ -119,6 +119,20 @@
"seat"
:
6
"seat"
:
6
}
}
]
]
},
{
"id"
:
"e770"
,
"userid"
:
"e770"
,
"selected"
:
[
{
"row"
:
7
,
"seat"
:
2
},
{
"row"
:
7
,
"seat"
:
3
}
]
}
}
]
]
}
}
\ No newline at end of file
jsconfig.json
0 → 100644
View file @
c8aa424e
{
"compilerOptions"
:
{
"baseUrl"
:
"src"
,
"paths"
:
{
"@components/*"
:
[
"components/*"
]
}
},
"include"
:
[
"src"
]
}
src/components/Layout/BookingWrapper/Index.jsx
View file @
c8aa424e
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
Seat
from
'./Seat'
;
import
Seat
from
'./Seat'
;
import
styles
from
'./styles.module.css'
;
import
styles
from
'./styles.module.css'
;
import
Button
from
'../../Base/Button/Index'
;
const
BookingWrapper
=
({
const
BookingWrapper
=
({
selectedSeats
,
selectedSeats
,
seatData
,
seatData
,
currentSeats
,
currentSeats
,
onSeatAdd
,
onSeatAdd
,
onSeatRemove
onSeatRemove
,
onSeatsConfirm
,
buttonState
})
=>
{
})
=>
{
const
handleSeatClick
=
(
row
,
seat
,
status
)
=>
{
const
handleSeatClick
=
(
row
,
seat
,
status
)
=>
{
if
(
status
==
'current-selected'
)
{
if
(
status
==
'current-selected'
)
{
...
@@ -73,6 +76,11 @@ const BookingWrapper = ({
...
@@ -73,6 +76,11 @@ const BookingWrapper = ({
})
}
})
}
</
div
>
</
div
>
))
}
))
}
<
div
className=
{
styles
[
'btn-wrapper'
]
}
>
<
Button
size=
{
'lg'
}
onClick=
{
onSeatsConfirm
}
disabled=
{
buttonState
}
>
Confirm
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
@@ -99,5 +107,7 @@ BookingWrapper.propTypes = {
...
@@ -99,5 +107,7 @@ BookingWrapper.propTypes = {
})
})
),
),
onSeatAdd
:
PropTypes
.
func
.
isRequired
,
onSeatAdd
:
PropTypes
.
func
.
isRequired
,
onSeatRemove
:
PropTypes
.
func
.
isRequired
onSeatRemove
:
PropTypes
.
func
.
isRequired
,
onSeatsConfirm
:
PropTypes
.
func
.
isRequired
,
buttonState
:
PropTypes
.
bool
.
isRequired
};
};
src/components/Layout/BookingWrapper/styles.module.css
View file @
c8aa424e
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
align-items
:
center
;
align-items
:
center
;
flex-direction
:
column
;
flex-direction
:
column
;
gap
:
10px
;
gap
:
10px
;
background-color
:
#3444c5
;
padding-bottom
:
0rem
;
}
}
.seat-row
{
.seat-row
{
...
@@ -45,6 +47,10 @@
...
@@ -45,6 +47,10 @@
width
:
100%
;
width
:
100%
;
}
}
.btn-wrapper
{
padding
:
1em
0
;
}
@media
screen
and
(
min-width
:
768px
)
{
@media
screen
and
(
min-width
:
768px
)
{
.seat
{
.seat
{
width
:
1.8em
;
width
:
1.8em
;
...
...
src/components/Layout/Header/styles.module.css
View file @
c8aa424e
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
align-items
:
center
;
align-items
:
center
;
width
:
100%
;
width
:
100%
;
gap
:
1rem
;
gap
:
1rem
;
background-color
:
#3444c5
;
}
}
.title
{
.title
{
...
...
src/components/Shared/LogoutButton/LogoutButton.stories.jsx
View file @
c8aa424e
...
@@ -5,7 +5,7 @@ export default {
...
@@ -5,7 +5,7 @@ export default {
component
:
LogoutButton
,
component
:
LogoutButton
,
argTypes
:
{
argTypes
:
{
onLogout
:
{
onLogout
:
{
action
:
'
hello
'
action
:
'
Logout
'
}
}
}
}
};
};
...
...
src/components/TopLevel/LegendWrapper/styles.module.css
View file @
c8aa424e
.LegendWrapper
{
.LegendWrapper
{
display
:
flex
;
display
:
flex
;
background-color
:
#3444c5
;
gap
:
1rem
;
gap
:
1rem
;
justify-content
:
center
;
justify-content
:
center
;
padding
:
1em
0
;
background-color
:
#3444c5
;
padding
:
1rem
0
;
}
}
@media
screen
and
(
min-width
:
768px
)
{
@media
screen
and
(
min-width
:
768px
)
{
...
...
src/components/TopLevel/Login/styles.module.css
View file @
c8aa424e
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
align-items
:
center
;
align-items
:
center
;
font-family
:
'Segoe UI'
,
sans-serif
;
font-family
:
'Segoe UI'
,
sans-serif
;
height
:
100vh
;
height
:
100vh
;
background-color
:
#3444c5
;
}
}
.container
{
.container
{
...
...
src/components/TopLevel/SeatSelectionContent/Index.jsx
View file @
c8aa424e
...
@@ -5,7 +5,7 @@ import Button from '../../Base/Button/Index';
...
@@ -5,7 +5,7 @@ import Button from '../../Base/Button/Index';
import
Modal
from
'../../Shared/Modal/Index'
;
import
Modal
from
'../../Shared/Modal/Index'
;
import
styles
from
'./styles.module.css'
;
import
styles
from
'./styles.module.css'
;
const
Index
=
({
onChange
,
onConfirm
,
disabled
})
=>
{
const
Index
=
({
onChange
,
onConfirm
})
=>
{
const
[
isDisabled
,
setIsDisabled
]
=
useState
(
true
);
const
[
isDisabled
,
setIsDisabled
]
=
useState
(
true
);
const
handleInputChange
=
(
e
)
=>
{
const
handleInputChange
=
(
e
)
=>
{
...
...
src/index.css
View file @
c8aa424e
@import
'../src/assets/fonts.css'
;
@import
'../src/assets/fonts.css'
;
body
{
body
{
margin
:
0
;
margin
:
0
;
}
}
html
,
body
{
html
,
body
{
height
:
100%
;
height
:
100%
;
width
:
100%
;
width
:
100%
;
}
}
#root
{
#root
{
height
:
100%
;
height
:
100%
;
width
:
100%
;
width
:
100%
;
background-color
:
#3444c5
;
}
}
src/pages/BookingPage/Index.jsx
View file @
c8aa424e
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
BookingWrapper
from
'../../components/Layout/BookingWrapper/Index'
;
import
BookingWrapper
from
'@components/Layout/BookingWrapper/Index'
;
import
Header
from
'../../components/Layout/Header/Index'
;
import
Header
from
'@components/Layout/Header/Index'
;
import
ConfirmSeatContent
from
'../../components/TopLevel/ConfirmSeatContent/Index'
;
import
ConfirmSeatContent
from
'@components/TopLevel/ConfirmSeatContent/Index'
;
import
SeatSelectionContent
from
'../../components/TopLevel/SeatSelectionContent/Index'
;
import
SeatSelectionContent
from
'@components/TopLevel/SeatSelectionContent/Index'
;
import
SuccessModal
from
'../../components/TopLevel/SuccessModal/Index'
;
import
SuccessModal
from
'@components/TopLevel/SuccessModal/Index'
;
import
Button
from
'../../components/Base/Button/Index'
;
import
LegendWrapper
from
'@components/TopLevel/LegendWrapper/Index'
;
import
LegendWrapper
from
'../../components/TopLevel/LegendWrapper/Index'
;
import
LogoutButton
from
'@components/Shared/LogoutButton/Index'
;
import
LogoutButton
from
'../../components/Shared/LogoutButton/Index'
;
import
{
getItem
,
reset
,
setItem
}
from
'../../lib/localStorage'
;
import
{
getItem
,
reset
,
setItem
}
from
'../../lib/localStorage'
;
import
{
appConstants
}
from
'../../lib/AppConstants'
;
import
{
appConstants
}
from
'../../lib/AppConstants'
;
...
@@ -18,9 +17,6 @@ import {
...
@@ -18,9 +17,6 @@ import {
createSeatApi
createSeatApi
}
from
'../../lib/api'
;
}
from
'../../lib/api'
;
import
img
from
'../../assets/images/power-button_12080802.png'
;
import
styles
from
'./styles.module.css'
;
const
data
=
[
const
data
=
[
[
'*'
,
1
,
2
,
3
,
'*'
,
4
,
5
,
6
,
'*'
],
[
'*'
,
1
,
2
,
3
,
'*'
,
4
,
5
,
6
,
'*'
],
[
1
,
2
,
3
,
4
,
'*'
,
5
,
6
,
7
,
8
],
[
1
,
2
,
3
,
4
,
'*'
,
5
,
6
,
7
,
8
],
...
@@ -95,13 +91,13 @@ const BookingPage = () => {
...
@@ -95,13 +91,13 @@ const BookingPage = () => {
}
}
};
};
const
modalClose
=
()
=>
{
const
handleSeatSelectionConfirm
=
()
=>
{
setItem
(
'modal'
,
false
);
setItem
(
'modal'
,
false
);
fetchSelectedSeats
();
fetchSelectedSeats
();
setShowSeatsModal
(
false
);
setShowSeatsModal
(
false
);
};
};
const
fin
alCancel
=
()
=>
{
const
handleMod
alCancel
=
()
=>
{
setShowSeatsConfirmationModal
(
false
);
setShowSeatsConfirmationModal
(
false
);
};
};
...
@@ -145,7 +141,7 @@ const BookingPage = () => {
...
@@ -145,7 +141,7 @@ const BookingPage = () => {
setShowSeatsConfirmationModal
(
true
);
setShowSeatsConfirmationModal
(
true
);
};
};
const
seatsFinal
=
async
()
=>
{
const
handleSeatBooking
=
async
()
=>
{
try
{
try
{
const
data
=
await
getSelectedSeatsApi
();
const
data
=
await
getSelectedSeatsApi
();
const
existingUserSeatMap
=
data
?.
find
((
ele
)
=>
ele
.
id
==
userId
);
const
existingUserSeatMap
=
data
?.
find
((
ele
)
=>
ele
.
id
==
userId
);
...
@@ -173,16 +169,8 @@ const BookingPage = () => {
...
@@ -173,16 +169,8 @@ const BookingPage = () => {
};
};
return
(
return
(
<
div
className=
{
styles
[
'seat-booking-wrapper'
]
}
>
<>
{
/* <img
<
LogoutButton
onLogout=
{
logout
}
/>
src={img}
className={styles['logout']}
width={30}
onClick={() => logout()}
title="Logout"
/> */
}
<
LogoutButton
/>
<
div
className=
{
styles
[
'screen-wrapper'
]
}
>
<
Header
>
Choose Seats
</
Header
>
<
Header
>
Choose Seats
</
Header
>
<
BookingWrapper
<
BookingWrapper
seatData=
{
data
}
seatData=
{
data
}
...
@@ -190,28 +178,27 @@ const BookingPage = () => {
...
@@ -190,28 +178,27 @@ const BookingPage = () => {
currentSeats=
{
currentSeats
}
currentSeats=
{
currentSeats
}
onSeatRemove=
{
handleSeatRemove
}
onSeatRemove=
{
handleSeatRemove
}
onSeatAdd=
{
handleSeatAdd
}
onSeatAdd=
{
handleSeatAdd
}
onSeatsConfirm=
{
handleSeatsConfirm
}
buttonState=
{
buttonState
}
/>
/>
</
div
>
<
div
className=
{
styles
[
'btn-wrapper'
]
}
>
<
Button
size=
{
'lg'
}
onClick=
{
handleSeatsConfirm
}
disabled=
{
buttonState
}
>
Confirm
</
Button
>
</
div
>
<
LegendWrapper
/>
<
LegendWrapper
/>
{
showSeatsModal
&&
(
{
showSeatsModal
&&
(
<
SeatSelectionContent
<
SeatSelectionContent
onChange=
{
onModalChange
}
onChange=
{
onModalChange
}
onConfirm=
{
modalClose
}
onConfirm=
{
handleSeatSelectionConfirm
}
disabled=
{
modalButtonState
}
disabled=
{
modalButtonState
}
/>
/>
)
}
)
}
{
showSeatsConfirmationModal
&&
(
{
showSeatsConfirmationModal
&&
(
<
ConfirmSeatContent
onConfirm=
{
seatsFinal
}
onCancel=
{
finalCancel
}
/>
<
ConfirmSeatContent
onConfirm=
{
handleSeatBooking
}
onCancel=
{
handleModalCancel
}
/>
)
}
)
}
{
showSuccessModal
&&
(
{
showSuccessModal
&&
(
<
SuccessModal
onConfirm=
{
handleSuccessModalConfirm
}
/>
<
SuccessModal
onConfirm=
{
handleSuccessModalConfirm
}
/>
)
}
)
}
</
div
>
</>
);
);
};
};
...
...
src/pages/BookingPage/styles.module.css
deleted
100644 → 0
View file @
046265a1
.seat-booking-wrapper
{
box-sizing
:
border-box
;
flex-direction
:
column
;
display
:
flex
;
justify-content
:
space-evenly
;
background-color
:
#3444c5
;
height
:
100%
;
overflow-y
:
auto
;
width
:
100%
;
}
.screen-wrapper
{
padding
:
0.5em
0
;
}
.btn-wrapper
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding
:
1em
0
;
}
.logout
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;
cursor
:
pointer
;
}
src/pages/LoginPage/Index.jsx
View file @
c8aa424e
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
Login
from
'
../../
components/TopLevel/Login/Index'
;
import
Login
from
'
@
components/TopLevel/Login/Index'
;
import
{
login
,
createUser
,
getSelectedSeatsApi
}
from
'../../lib/api'
;
import
{
login
,
createUser
,
getSelectedSeatsApi
}
from
'../../lib/api'
;
import
{
setItem
}
from
'../../lib/localStorage'
;
import
{
setItem
}
from
'../../lib/localStorage'
;
...
...
src/pages/LoginPage/styles.module.css
deleted
100644 → 0
View file @
046265a1
vite.config.js
View file @
c8aa424e
import
{
defineConfig
}
from
'vite'
import
{
defineConfig
}
from
'vite'
;
import
react
from
'@vitejs/plugin-react'
import
react
from
'@vitejs/plugin-react'
;
import
path
from
'path'
;
// https://vite.dev/config/
// https://vite.dev/config/
export
default
defineConfig
({
export
default
defineConfig
({
plugins
:
[
react
()],
plugins
:
[
react
()],
})
resolve
:
{
alias
:
{
'@components'
:
path
.
resolve
(
__dirname
,
'src/components'
)
// Add more aliases as needed
}
}
});
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