Commit 63ad5fb3 by Manivasagam S

code changes

parent 638c7a16
...@@ -47,9 +47,9 @@ export const Auth = ({ ...@@ -47,9 +47,9 @@ export const Auth = ({
{isLoginMode ? ( {isLoginMode ? (
<div className={styles.login}> <div className={styles.login}>
<LoginComponent onLogin={onLoginSubmit} /> <LoginComponent onLogin={onLoginSubmit} />
{showForgotPassword && ( {/* {showForgotPassword && (
<a href="#" className={styles.forgotLink}>Forgot password?</a> <a href="#" className={styles.forgotLink}>Forgot password?</a>
)} )} */}
</div> </div>
) : ( ) : (
<div className={styles.signup}> <div className={styles.signup}>
......
...@@ -6,16 +6,16 @@ body{ ...@@ -6,16 +6,16 @@ body{
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
font-family: Arial, sans-serif; font-family:'Segoe UI';
} }
.formCard { .formCard {
background: #fff; background: #fff;
padding: 40px 30px; padding: 2.5rem 1.5rem;
border-radius: 12px; border-radius: 12px;
width: 350px; width: 22rem;
max-width: 400px; max-width: 25rem;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
text-align: center; text-align: center;
margin-left: 2rem ; margin-left: 2rem ;
...@@ -23,9 +23,9 @@ body{ ...@@ -23,9 +23,9 @@ body{
} }
.header { .header {
font-size: 24px; font-size: 1.5rem;
font-weight: bold; font-weight: bold;
margin-bottom: 25px; margin-bottom: 1.563rem;
} }
.tabContainer { .tabContainer {
...@@ -33,15 +33,15 @@ body{ ...@@ -33,15 +33,15 @@ body{
justify-content: space-between; justify-content: space-between;
background: #f0f0f0; background: #f0f0f0;
border-radius: 30px; border-radius: 30px;
margin-bottom: 20px; margin-bottom: 1.25rem;
padding: 5px; padding: 5px;
} }
.tabButton { .tabButton {
flex: 1; flex: 1;
padding: 10px; padding: 0.625rem;
border: none; border: none;
border-radius: 30px; border-radius: 2rem;
font-weight: bold; font-weight: bold;
background: transparent; background: transparent;
cursor: pointer; cursor: pointer;
...@@ -76,8 +76,8 @@ body{ ...@@ -76,8 +76,8 @@ body{
} }
.signupPrompt { .signupPrompt {
margin-top: 15px; margin-top: 1rem;
font-size: 13px; font-size: 0.813rem;
color: #333; color: #333;
} }
......
...@@ -4,7 +4,7 @@ import { SignUp } from "../Form/SignUp/SignUp.jsx"; ...@@ -4,7 +4,7 @@ import { SignUp } from "../Form/SignUp/SignUp.jsx";
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
export default { export default {
title: "Auth/Auth", title: "Auth/AuthCard",
component: Auth, component: Auth,
argTypes: { argTypes: {
loginLabel: { control: "text", name: "Login Title" }, loginLabel: { control: "text", name: "Login Title" },
...@@ -36,7 +36,7 @@ const DummySignUp = ({ onSubmit }) => ( ...@@ -36,7 +36,7 @@ const DummySignUp = ({ onSubmit }) => (
</div> </div>
); );
export const AuthTabs = (args) => ( export const ModeSwitcher = (args) => (
<Auth <Auth
{...args} {...args}
LoginComponent={DummyLogin} LoginComponent={DummyLogin}
...@@ -46,7 +46,7 @@ export const AuthTabs = (args) => ( ...@@ -46,7 +46,7 @@ export const AuthTabs = (args) => (
/> />
); );
AuthTabs.args = { ModeSwitcher.args = {
loginLabel: "Login Form", loginLabel: "Login Form",
signupLabel: "SignUp Form", signupLabel: "SignUp Form",
loginTabLabel: "Login", loginTabLabel: "Login",
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
cursor: pointer; cursor: pointer;
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
display: inline-block; display: inline-block;
padding:10px; padding:0.625rem;
font-weight: 600; font-weight: 600;
} }
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
.secondary { .secondary {
background-color: var(--secondary); background-color: var(--secondary);
color: black; color: black;
border-radius: 15px; border-radius: 1rem;
width: 100%; width: 100%;
/* min-width: 12rem; */ /* min-width: 12rem; */
} }
...@@ -96,16 +96,16 @@ ...@@ -96,16 +96,16 @@
.sm { .sm {
font-size: 0.875rem; font-size: 0.875rem;
padding: 8px 16px; padding: 0.5rem 1rem;
} }
.md { .md {
font-size: 1.2rem; font-size: 1.2rem;
padding: 12px 20px; padding: 0.75rem 1.25rem;
} }
.lg { .lg {
font-size: 1.125rem; font-size: 1.125rem;
padding: 16px 24px; padding: 1rem 1.5rem;
} }
.loading{ .loading{
cursor: wait !important; cursor: wait !important;
......
import React from 'react' import React from 'react'
import styles from "./Input.module.css" import styles from "./Input.module.css"
import { ErrorFormatter } from 'storybook/internal/components' import { ErrorFormatter } from 'storybook/internal/components'
export const Input =({type='text',placeholder='',isInvalid=false,onChange,value='',errorMessage="",variant,...props}) => { export const Input =({type='text',placeholder='',isInvalid=false,onChange,value='',errorMessage="",...props}) => {
return ( return (
<div > <div >
<input className={`${styles.inputbox} ${isInvalid && styles.invalid}`} type={type} placeholder={placeholder} onChange={onChange} {...props}/> <input className={`${styles.inputbox} ${isInvalid && styles.invalid}`} type={type} placeholder={placeholder} onChange={onChange} {...props}/>
......
.inputbox{ .inputbox{
padding: 12px 14px; padding: 0.75rem 0.875rem;
font-size: 1rem; font-size: 1rem;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 6px; border-radius: 6px;
......
...@@ -13,7 +13,6 @@ export const Default = { ...@@ -13,7 +13,6 @@ export const Default = {
args: { args: {
type: "text", type: "text",
placeholder: "Enter mobile number", placeholder: "Enter mobile number",
variant: "inputbox",
}, },
render: (args) => ( render: (args) => (
<div> <div>
......
...@@ -27,25 +27,25 @@ ...@@ -27,25 +27,25 @@
} }
.modalheading { .modalheading {
font-size: 24px; font-size: 1.5rem;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
color: #1f2937; color: #1f2937;
margin-bottom: 16px; margin-bottom: 1rem;
} }
.modalform { .modalform {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 1rem;
} }
.modalselect { .modalselect {
padding: 10px; padding: 10px;
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 8px; border-radius: 0.5rem;
font-size: 16px; font-size: 1rem;
outline: none; outline: none;
transition: border-color 0.3s; transition: border-color 0.3s;
width: 100%; width: 100%;
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
.modalbutton { .modalbutton {
background-color: #2563eb; background-color: #2563eb;
color: white; color: white;
padding: 10px; padding: 0.625rem;
border: none; border: none;
border-radius: 8px; border-radius: 0.5rem;
font-size: 16px; font-size: 1rem;
cursor: pointer; cursor: pointer;
transition: background-color 0.3s; transition: background-color 0.3s;
......
...@@ -5,7 +5,7 @@ export const Select = ({ label, options, value, onChange }) => { ...@@ -5,7 +5,7 @@ export const Select = ({ label, options, value, onChange }) => {
<div className={styles.container}> <div className={styles.container}>
{label && <label className={styles.label}>{label}</label>} {label && <label className={styles.label}>{label}</label>}
<select className={styles.select} value={value} onChange={onChange} > <select className={styles.select} value={value} onChange={onChange} >
{options.map((opt, index) => ( {(options || []).map((opt, index) => (
<option key={index} value={opt.value} className={styles.option}> <option key={index} value={opt.value} className={styles.option}>
{opt.label} {opt.label}
</option> </option>
......
...@@ -10,7 +10,18 @@ ...@@ -10,7 +10,18 @@
} }
.select { .select {
padding: 0.5rem; padding: 0.6rem;
font-size: 1rem; font-size: 1rem;
border-radius: 4px; border-radius: 4px;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background: url('data:image/svg+xml;utf8,<svg fill="black" height="12" viewBox="0 0 24 24" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>')
no-repeat right 12px center;
background-color: white;
border-radius: 4px;
} }
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
font-size: 1.7rem; font-size: 1.7rem;
font-family:'Segoe UI'; font-family:'Segoe UI';
color: black; color: black;
margin-bottom: 24px; margin-bottom: 1.5rem;
text-align: center; text-align: center;
} }
.form { .form {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 1rem;
} }
.form input[type="text"]:focus { .form input[type="text"]:focus {
......
import { Login } from "./Login"; import { Login } from "./Login";
export default { export default {
title: "Toplevel/Login", title: "Form/Login",
component: Login, component: Login,
parameters: { parameters: {
backgrounds: { default: 'light',value:'F8F8F8' } backgrounds: { default: 'light',value:'F8F8F8' }
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
.modalbutton { .modalbutton {
background-color: #2563eb; background-color: #2563eb;
color: white; color: white;
padding: 10px; padding: 0.625rem;
border: none; border: none;
border-radius: 8px; border-radius: 0.5rem;
font-size: 16px; font-size: 1rem;
cursor: pointer; cursor: pointer;
transition: background-color 0.3s; transition: background-color 0.3s;
} }
......
import React from "react";
import { SeatSelectForm } from "../../Form/SeatSelectForm/SeatSelectForm.jsx";
import { action } from "@storybook/addon-actions";
const seatOptions = [
{ value: 1, label: "1 Seat" },
{ value: 2, label: "2 Seats" },
{ value: 3, label: "3 Seats" },
{ value: 4, label: "4 Seats" },
{ value: 5, label: "5 Seats" },
];
export default {
title: "Form/SeatSelect",
component: SeatSelectForm,
args: {
seatOptions,
setSeatCount: action("Seat count changed"),
onClose: action("Continue clicked"),
},
};
export const seatSelectForm = (args) => (
<SeatSelectForm
{...args}
/>
);
...@@ -2,7 +2,7 @@ import { SignUp } from "./SignUp.jsx"; ...@@ -2,7 +2,7 @@ import { SignUp } from "./SignUp.jsx";
import React from "react"; import React from "react";
export default { export default {
title: "Toplevel/SignUp", title: "Form/SignUp",
component: SignUp, component: SignUp,
parameters: { parameters: {
backgrounds: { backgrounds: {
......
.logoutButton{ .logoutButton {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
position: relative; position: relative;
top: 2rem; top: 2rem;
right: 1.5rem; right: 1.5rem;
color: white; color: white;
font-size: 2rem; font-size: 2rem;
} }
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin-top:12rem; justify-content: center;
margin-top: 20rem;
text-align: center; text-align: center;
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
animation: fadeIn 0.5s ease-in-out; animation: fadeIn 0.5s ease-in-out;
width: 100%; width: 100%;
height: 100%; max-width: 25rem;
} background-color: #eff0ef;
.button{ padding: 3rem;
max-width: 12rem; border-radius: 2rem;
margin: 10rem auto;
} }
.container:hover {
/* .container:hover {
transform: scale(1.02); transform: scale(1.02);
opacity: 0.95; opacity: 0.95;
} */
.span {
font-size: 4rem;
margin-bottom: 0.5rem;
} }
.title { .title {
margin-bottom: 0.5em; margin-bottom: 0.5em;
font-size: 1.5rem; font-size: 1.5rem;
color:white; color: rgb(16, 15, 15);
font-weight: bold; font-weight: bold;
font-family: 'Segoe UI'; font-family: 'Segoe UI';
} }
.span { .msg {
font-size: 4rem; font-size: 1.5rem;
margin-bottom: 0.5rem; color: rgb(16, 15, 15);
margin-top: 0.5rem;
line-height: 1.5;
font-family: 'Segoe UI';
font-weight: bold;
margin-bottom: 2rem;
} }
.success { .success {
color: #2ecc71; /* green */ color: #2ecc71;
width: 9.375rem;
height: auto;
animation: rotate 1s linear, glow 7s ease-in-out alternate;
} }
.error { .error {
color: #e74c3c; /* red */ color: #e74c3c;
height:9.375rem;
width: 12.5rem;
} }
.msg { .button {
font-size: 1.5rem; max-width: 12rem;
color:white; width: 100%;
margin-top: 0.5rem; text-align: center;
line-height: 1.5; }
font-family: 'Segoe UI';
.button button {
width: 100%;
padding: 0.75rem 1.5rem;
background-color: #007bff;
color: white;
font-size: 1rem;
border: none;
border-radius: 0.5rem;
font-weight: bold; font-weight: bold;
margin-bottom: 2rem; cursor: pointer;
transition: background-color 0.3s ease-in-out, transform 0.2s;
}
.button button:hover {
background-color: #0056b3;
transform: translateY(-2px);
}
.button button:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
} }
@keyframes fadeIn { @keyframes fadeIn {
...@@ -67,11 +106,6 @@ font-size: 2rem; ...@@ -67,11 +106,6 @@ font-size: 2rem;
transform: translateY(0); transform: translateY(0);
} }
} }
.success {
width: 150px;
height: auto;
animation: rotate 1s linear , glow 7s ease-in-out alternate;
}
@keyframes rotate { @keyframes rotate {
0% { 0% {
...@@ -82,7 +116,6 @@ font-size: 2rem; ...@@ -82,7 +116,6 @@ font-size: 2rem;
} }
} }
@keyframes glow { @keyframes glow {
from { from {
filter: drop-shadow(0 0 5px #ffffff); filter: drop-shadow(0 0 5px #ffffff);
...@@ -91,7 +124,3 @@ font-size: 2rem; ...@@ -91,7 +124,3 @@ font-size: 2rem;
filter: drop-shadow(0 0 20px #eff0ef); filter: drop-shadow(0 0 20px #eff0ef);
} }
} }
.error{
height: 150px;
width: 200px;
}
\ No newline at end of file
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin:0 auto; margin:0 auto;
margin-top: 15px; margin-top: 1rem;
gap: 35px; gap: 2.188px;
width: 100%; width: 100%;
/* /*
flex-direction: column; */ flex-direction: column; */
...@@ -47,34 +47,34 @@ ...@@ -47,34 +47,34 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 3px; gap: 3px;
font-size: 14px; font-size: 0.875px;
color: white; color: white;
font-family: 'Segoe UI'; font-family: 'Segoe UI';
font-weight: 500; font-weight: 500;
font-size: 13px; font-size: 0.813rem;
} }
@media(min-width:425px){ @media(min-width:425px){
.legend{ .legend{
column-gap: 80px; column-gap: 5rem;
} }
.legendItem{ .legendItem{
font-size: 15px; font-size: 0.938rem;
} }
} }
@media (min-width:640px) { @media (min-width:640px) {
.seat{ .seat{
width: 10px; width: 0.625rem;
height: 10px; height: 0.625rem;
} }
.legend{ .legend{
flex-direction: row; flex-direction: row;
column-gap: 150px; column-gap: 9.375rem;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.legendItem{ .legendItem{
gap: 15px; gap: 0.938rem;
font-size: 20px; font-size: 1.25rem;
} }
} }
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
.noSeat { .noSeat {
display: inline-block; display: inline-block;
width: 30px; width: 1.875rem;
height: 30px; height: 1.875rem;
margin: 5px; margin: 5px;
cursor: context-menu; cursor: context-menu;
background: transparent; background: transparent;
...@@ -63,15 +63,15 @@ ...@@ -63,15 +63,15 @@
.seat::before { .seat::before {
bottom: 150%; bottom: 150%;
margin-left: -30px; margin-left: -1.875rem;
padding: 5px; padding: 5px;
width: 60px; width: 3.75rem;
border-radius: 3px; border-radius: 3px;
background-color: #f7f4f4; background-color: #f7f4f4;
color: #080808; color: #080808;
content: attr(data-tooltip); content: attr(data-tooltip);
text-align: center; text-align: center;
font-size: 12px; font-size: 0.75rem;
line-height: 1.2; line-height: 1.2;
} }
...@@ -96,15 +96,15 @@ ...@@ -96,15 +96,15 @@
} }
@media (min-width:425px){ @media (min-width:425px){
.seat{ .seat{
width:23px; width:1.438rem;
height: 23px; height:1.438rem;
margin: 8px; margin: 0.5rem;
} }
} }
@media (min-width:640px){ @media (min-width:640px){
.seat{ .seat{
width:27px; width:1.688rem;
height:27px; height:1.688rem;
margin: 8px; margin: 8px;
} }
......
...@@ -42,7 +42,7 @@ margin-left: 1px; ...@@ -42,7 +42,7 @@ margin-left: 1px;
} }
@media (min-width:640px) { @media (min-width:640px) {
.seatcontainer{ .seatcontainer{
gap: 8px; gap: 0.5rem;
padding: 2px 2px; padding: 2px 2px;
} }
.container{ .container{
......
...@@ -11,7 +11,7 @@ import { Modal } from "../../Base/Modal/Modal"; ...@@ -11,7 +11,7 @@ import { Modal } from "../../Base/Modal/Modal";
import { SeatSelectForm } from "../../Form/SeatSelectForm/SeatSelectForm"; import { SeatSelectForm } from "../../Form/SeatSelectForm/SeatSelectForm";
import { Screen } from "../../Shared/Screen/Screen"; import { Screen } from "../../Shared/Screen/Screen";
import { AiOutlineLogout } from "react-icons/ai"; import { AiOutlineLogout } from "react-icons/ai";
import { useRef } from "react";
export const Selectseat = ({ onLogout }) => { export const Selectseat = ({ onLogout }) => {
const [selectedSeats, setSelectedSeats] = useState([]); const [selectedSeats, setSelectedSeats] = useState([]);
const [selectedData, setselectedData] = useState([]); const [selectedData, setselectedData] = useState([]);
...@@ -20,6 +20,8 @@ export const Selectseat = ({ onLogout }) => { ...@@ -20,6 +20,8 @@ export const Selectseat = ({ onLogout }) => {
const [availableSeats, setAvailableSeats] = useState(0); const [availableSeats, setAvailableSeats] = useState(0);
const [showSelect, setShowSelect] = useState(true); const [showSelect, setShowSelect] = useState(true);
const hasWelcomed = useRef(false);
useEffect(() => { useEffect(() => {
getAllUsers() getAllUsers()
.then(res => { .then(res => {
...@@ -41,7 +43,11 @@ export const Selectseat = ({ onLogout }) => { ...@@ -41,7 +43,11 @@ export const Selectseat = ({ onLogout }) => {
if (userSeats.length > 0) { if (userSeats.length > 0) {
setSeatCount(userSeats.length); setSeatCount(userSeats.length);
setShowSelect(false); // skip modal for existing users setShowSelect(false);
}
if (currentUser?.name && !hasWelcomed.current) {
toast.success(`Welcome, ${currentUser.name}`);
hasWelcomed.current = true;
} }
}) })
.catch(err => { .catch(err => {
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
"B3", "B3",
"B2", "B2",
"B1", "B1",
"C5", "D6",
"D6" "D7",
"C7"
] ]
}, },
{ {
...@@ -143,6 +144,13 @@ ...@@ -143,6 +144,13 @@
"D1", "D1",
"D2" "D2"
] ]
},
{
"id": "f129",
"name": "mani",
"email": "mani@gmail.com",
"phoneNumber": "8976543210",
"reservedSeats": []
} }
] ]
} }
\ No newline at end of file
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