Commit 40192bec by Manivasagam S

code changes

parent 7260cb25
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 = () => {
......
......@@ -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/userApi';
import { getUserByPhone } from '../../../Api/Api';
import 'react-toastify/dist/ReactToastify.css';
export const SignUp = ({
......
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 { 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";
......
......@@ -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/userApi.js";
import { getUserByPhone,postUser } from "@/Api/Api.js";
export const AuthPage = () => {
const handleLogin = async (phoneNumber) => {
try {
......
import { Selectseat } from "@/Components/Top-level/Seatselect/Selectseat";
import { logout } from "@/auth/authService";
import { logout } from "@/lib/authService";
export const Bookingpage = () => {
const onLogout = () => {
......
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>
);
};
......@@ -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"
]
},
{
......
......@@ -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;
}
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