Commit 40192bec by Manivasagam S

code changes

parent 7260cb25
import React from 'react'; import React from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom'; import { BrowserRouter, Routes, Route } from 'react-router-dom';
import './App.css'; import './index.css'
import { AuthPage } from './Pages/AuthPage.jsx'; 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 { Bookingpage } from './Pages/BookingPage.jsx';
import { SuccessPage } from './Pages/SuccessPage.jsx'; import { SuccessPage } from './Pages/SuccessPage.jsx';
export const App = () => { export const App = () => {
......
...@@ -2,7 +2,7 @@ import React, { useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { Input } from '@/Components/Base/Input/Input'; import { Input } from '@/Components/Base/Input/Input';
import { Button } from '@/Components/Base/Buttons/Button'; import { Button } from '@/Components/Base/Buttons/Button';
import styles from "@/Components/Form/SignUp/SignUp.module.css"; import styles from "@/Components/Form/SignUp/SignUp.module.css";
import { getUserByPhone } from '../../../Api/userApi'; import { getUserByPhone } from '../../../Api/Api';
import 'react-toastify/dist/ReactToastify.css'; import 'react-toastify/dist/ReactToastify.css';
export const SignUp = ({ export const SignUp = ({
......
import { useEffect, useState, useRef } from "react"; import { useEffect, useState, useRef } from "react";
import { getAllUsers, updateUserReservedSeats } from "@/Api/userApi"; import { getAllUsers, updateUserReservedSeats } from "@/Api/Api";
import { Button } from "@/Components/Base/Buttons/Button"; import { Button } from "@/Components/Base/Buttons/Button";
import { Legend } from "@/Components/Top-level/Seat-legend/Legend"; import { Legend } from "@/Components/Top-level/Seat-legend/Legend";
import { SeatLayout } from "@/Components/Top-level/SeatLayout/SeatLayout"; 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 styles from "@/Components/Top-level/SeatSelect/Selectseat.module.css";
import "react-toastify/dist/ReactToastify.css"; import "react-toastify/dist/ReactToastify.css";
import { toast, ToastContainer } from "react-toastify"; import { toast, ToastContainer } from "react-toastify";
......
...@@ -2,7 +2,7 @@ import { Login} from "@/Components/Form/Login/Login.jsx" ...@@ -2,7 +2,7 @@ import { Login} from "@/Components/Form/Login/Login.jsx"
import { SignUp } from "@/Components/Form/SignUp/SignUp"; import { SignUp } from "@/Components/Form/SignUp/SignUp";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import { Auth } from "@/Components/Auth/Auth.jsx"; import { Auth } from "@/Components/Auth/Auth.jsx";
import { getUserByPhone,postUser } from "@/Api/userApi.js"; import { getUserByPhone,postUser } from "@/Api/Api.js";
export const AuthPage = () => { export const AuthPage = () => {
const handleLogin = async (phoneNumber) => { const handleLogin = async (phoneNumber) => {
try { try {
......
import { Selectseat } from "@/Components/Top-level/Seatselect/Selectseat"; import { Selectseat } from "@/Components/Top-level/Seatselect/Selectseat";
import { logout } from "@/auth/authService"; import { logout } from "@/lib/authService";
export const Bookingpage = () => { export const Bookingpage = () => {
const onLogout = () => { const onLogout = () => {
......
import styled from "styled-components";
import { Success } from "@/Components/Top-level/Response/Success/Success"; import { Success } from "@/Components/Top-level/Response/Success/Success";
import { logout } from "@/auth/authService"; import { logout } from "@/lib/authService";
import { AiOutlineLogout } from "react-icons/ai"; import { AiOutlineLogout } from "react-icons/ai";
import "@/index.css";
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;
`;
export const SuccessPage = () => { export const SuccessPage = () => {
const onLogout = () => { const onLogout = () => {
...@@ -25,11 +9,11 @@ export const SuccessPage = () => { ...@@ -25,11 +9,11 @@ export const SuccessPage = () => {
}; };
return ( return (
<Container> <div className="success-container">
<LogoutButton> <div className="success-logout-button" onClick={onLogout}>
<AiOutlineLogout onClick={onLogout} /> <AiOutlineLogout />
</LogoutButton> </div>
<Success /> <Success />
</Container> </div>
); );
}; };
...@@ -6,13 +6,7 @@ ...@@ -6,13 +6,7 @@
"name": "Mani", "name": "Mani",
"reservedSeats": [ "reservedSeats": [
"G3", "G3",
"E4", "E4"
"G4",
"F4",
"E3",
"F7",
"E8",
"G8"
] ]
}, },
{ {
...@@ -21,35 +15,7 @@ ...@@ -21,35 +15,7 @@
"name": "mani", "name": "mani",
"reservedSeats": [ "reservedSeats": [
"F2", "F2",
"F1", "B3"
"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"
] ]
}, },
{ {
...@@ -164,10 +130,7 @@ ...@@ -164,10 +130,7 @@
"email": "suji@gmail.com", "email": "suji@gmail.com",
"phoneNumber": "9876543210", "phoneNumber": "9876543210",
"reservedSeats": [ "reservedSeats": [
"E1", "E1"
"E2",
"D1",
"D2"
] ]
}, },
{ {
...@@ -184,10 +147,7 @@ ...@@ -184,10 +147,7 @@
"phoneNumber": "9080296978", "phoneNumber": "9080296978",
"reservedSeats": [ "reservedSeats": [
"D7", "D7",
"C7", "B7"
"B7",
"C6",
"C8"
] ]
}, },
{ {
......
...@@ -18,3 +18,20 @@ ...@@ -18,3 +18,20 @@
h1,h2,h3,h4,h5,h6,p{ h1,h2,h3,h4,h5,h6,p{
font-family: 'Segoe UI'; 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;
}
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]));
};
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