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
40192bec
Commit
40192bec
authored
Jun 20, 2025
by
Manivasagam S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code changes
parent
7260cb25
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
36 additions
and
89 deletions
+36
-89
Api.js
src/Api/Api.js
+0
-0
App.jsx
src/App.jsx
+2
-2
SignUp.jsx
src/Components/Form/SignUp/SignUp.jsx
+1
-1
Selectseat.jsx
src/Components/Top-level/Seatselect/Selectseat.jsx
+2
-2
AuthPage.jsx
src/Pages/AuthPage.jsx
+1
-1
BookingPage.jsx
src/Pages/BookingPage.jsx
+1
-1
SuccessPage.jsx
src/Pages/SuccessPage.jsx
+8
-24
db.json
src/db.json
+4
-44
index.css
src/index.css
+17
-0
ProtectedRoute.jsx
src/lib/ProtectedRoute.jsx
+0
-0
authService.js
src/lib/authService.js
+0
-0
seatUtils.js
src/utils/seatUtils.js
+0
-14
No files found.
src/Api/
user
Api.js
→
src/Api/Api.js
View file @
40192bec
File moved
src/App.jsx
View file @
40192bec
import
React
from
'react'
;
import
{
BrowserRouter
,
Routes
,
Route
}
from
'react-router-dom'
;
import
'./
App.css'
;
import
'./
index.css'
import
{
AuthPage
}
from
'./Pages/AuthPage.jsx'
;
import
{
ProtectedRoute
}
from
'./
auth
/ProtectedRoute.jsx'
;
import
{
ProtectedRoute
}
from
'./
lib
/ProtectedRoute.jsx'
;
import
{
Bookingpage
}
from
'./Pages/BookingPage.jsx'
;
import
{
SuccessPage
}
from
'./Pages/SuccessPage.jsx'
;
export
const
App
=
()
=>
{
...
...
src/Components/Form/SignUp/SignUp.jsx
View file @
40192bec
...
...
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import
{
Input
}
from
'@/Components/Base/Input/Input'
;
import
{
Button
}
from
'@/Components/Base/Buttons/Button'
;
import
styles
from
"@/Components/Form/SignUp/SignUp.module.css"
;
import
{
getUserByPhone
}
from
'../../../Api/
user
Api'
;
import
{
getUserByPhone
}
from
'../../../Api/Api'
;
import
'react-toastify/dist/ReactToastify.css'
;
export
const
SignUp
=
({
...
...
src/Components/Top-level/Seatselect/Selectseat.jsx
View file @
40192bec
import
{
useEffect
,
useState
,
useRef
}
from
"react"
;
import
{
getAllUsers
,
updateUserReservedSeats
}
from
"@/Api/
user
Api"
;
import
{
getAllUsers
,
updateUserReservedSeats
}
from
"@/Api/Api"
;
import
{
Button
}
from
"@/Components/Base/Buttons/Button"
;
import
{
Legend
}
from
"@/Components/Top-level/Seat-legend/Legend"
;
import
{
SeatLayout
}
from
"@/Components/Top-level/SeatLayout/SeatLayout"
;
import
{
getCurrentUser
}
from
"@/
auth
/authService"
;
import
{
getCurrentUser
}
from
"@/
lib
/authService"
;
import
styles
from
"@/Components/Top-level/SeatSelect/Selectseat.module.css"
;
import
"react-toastify/dist/ReactToastify.css"
;
import
{
toast
,
ToastContainer
}
from
"react-toastify"
;
...
...
src/Pages/AuthPage.jsx
View file @
40192bec
...
...
@@ -2,7 +2,7 @@ import { Login} from "@/Components/Form/Login/Login.jsx"
import
{
SignUp
}
from
"@/Components/Form/SignUp/SignUp"
;
import
{
toast
}
from
"react-toastify"
;
import
{
Auth
}
from
"@/Components/Auth/Auth.jsx"
;
import
{
getUserByPhone
,
postUser
}
from
"@/Api/
user
Api.js"
;
import
{
getUserByPhone
,
postUser
}
from
"@/Api/Api.js"
;
export
const
AuthPage
=
()
=>
{
const
handleLogin
=
async
(
phoneNumber
)
=>
{
try
{
...
...
src/Pages/BookingPage.jsx
View file @
40192bec
import
{
Selectseat
}
from
"@/Components/Top-level/Seatselect/Selectseat"
;
import
{
logout
}
from
"@/
auth
/authService"
;
import
{
logout
}
from
"@/
lib
/authService"
;
export
const
Bookingpage
=
()
=>
{
const
onLogout
=
()
=>
{
...
...
src/Pages/SuccessPage.jsx
View file @
40192bec
import
styled
from
"styled-components"
;
import
{
Success
}
from
"@/Components/Top-level/Response/Success/Success"
;
import
{
logout
}
from
"@/auth/authService"
;
import
{
AiOutlineLogout
}
from
"react-icons/ai"
;
const
Container
=
styled
.
div
`
position: relative;
`
;
const
LogoutButton
=
styled
.
div
`
display: flex;
justify-content: flex-end;
position: relative;
top:3rem;
right: 1.5rem;
color: white;
font-size: 1.8rem;
z-index: 1001;
cursor: pointer;
`
;
import
{
logout
}
from
"@/lib/authService"
;
import
{
AiOutlineLogout
}
from
"react-icons/ai"
;
import
"@/index.css"
;
export
const
SuccessPage
=
()
=>
{
const
onLogout
=
()
=>
{
...
...
@@ -25,11 +9,11 @@ export const SuccessPage = () => {
};
return
(
<
Container
>
<
LogoutButton
>
<
AiOutlineLogout
onClick=
{
onLogout
}
/>
</
LogoutButton
>
<
div
className=
"success-container"
>
<
div
className=
"success-logout-button"
onClick=
{
onLogout
}
>
<
AiOutlineLogout
/>
</
div
>
<
Success
/>
</
Container
>
</
div
>
);
};
src/db.json
View file @
40192bec
...
...
@@ -6,13 +6,7 @@
"name"
:
"Mani"
,
"reservedSeats"
:
[
"G3"
,
"E4"
,
"G4"
,
"F4"
,
"E3"
,
"F7"
,
"E8"
,
"G8"
"E4"
]
},
{
...
...
@@ -21,35 +15,7 @@
"name"
:
"mani"
,
"reservedSeats"
:
[
"F2"
,
"F1"
,
"F8"
,
"E7"
,
"G2"
,
"D6"
,
"D5"
,
"G7"
,
"A4"
,
"A5"
,
"A6"
,
"B2"
,
"B3"
,
"D8"
,
"B1"
,
"H4"
,
"H5"
,
"C1"
,
"A3"
,
"A2"
,
"C2"
,
"G5"
,
"G6"
,
"G1"
,
"H3"
,
"H6"
,
"F3"
,
"E5"
,
"F6"
,
"B8"
"B3"
]
},
{
...
...
@@ -164,10 +130,7 @@
"email"
:
"suji@gmail.com"
,
"phoneNumber"
:
"9876543210"
,
"reservedSeats"
:
[
"E1"
,
"E2"
,
"D1"
,
"D2"
"E1"
]
},
{
...
...
@@ -184,10 +147,7 @@
"phoneNumber"
:
"9080296978"
,
"reservedSeats"
:
[
"D7"
,
"C7"
,
"B7"
,
"C6"
,
"C8"
"B7"
]
},
{
...
...
src/index.css
View file @
40192bec
...
...
@@ -18,3 +18,20 @@
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
p
{
font-family
:
'Segoe UI'
;
}
.success-container
{
position
:
relative
;
}
.success-logout-button
{
display
:
flex
;
justify-content
:
flex-end
;
position
:
relative
;
top
:
3rem
;
right
:
1.5rem
;
color
:
white
;
font-size
:
1.8rem
;
z-index
:
1001
;
cursor
:
pointer
;
}
src/
auth
/ProtectedRoute.jsx
→
src/
lib
/ProtectedRoute.jsx
View file @
40192bec
File moved
src/
auth
/authService.js
→
src/
lib
/authService.js
View file @
40192bec
File moved
src/utils/seatUtils.js
deleted
100644 → 0
View file @
7260cb25
export
const
generateAllSeats
=
()
=>
{
const
rows
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
];
const
seats
=
[];
for
(
let
row
of
rows
)
{
for
(
let
i
=
1
;
i
<=
8
;
i
++
)
{
seats
.
push
(
`
${
row
}${
i
}
`
);
}
}
return
seats
;
};
export
const
mergeReservedSeats
=
(
existing
=
[],
newSeats
=
[])
=>
{
return
Array
.
from
(
new
Set
([...
existing
,
...
newSeats
]));
};
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