Commit d3483b4f by Sujeeth AV

Your commit message here

parent 3b117683
...@@ -124,15 +124,18 @@ ...@@ -124,15 +124,18 @@
"id": "6543217890", "id": "6543217890",
"Mobile": "6543217890", "Mobile": "6543217890",
"Name": "praba" "Name": "praba"
},
{
"id": "9078563412",
"Mobile": "9078563412",
"Name": "Raja"
} }
], ],
"seats": [ "seats": [
{ {
"userId": "9677655288", "userId": "9677655288",
"seats": [ "seats": [
"D1", "A1"
"D2",
"D3"
], ],
"status": "booked", "status": "booked",
"id": "4271" "id": "4271"
...@@ -151,7 +154,9 @@ ...@@ -151,7 +154,9 @@
{ {
"userId": "9500403346", "userId": "9500403346",
"seats": [ "seats": [
"F3" "D1",
"D2",
"D5"
], ],
"status": "booked", "status": "booked",
"id": "b4fe" "id": "b4fe"
...@@ -203,6 +208,17 @@ ...@@ -203,6 +208,17 @@
"E8" "E8"
], ],
"status": "booked" "status": "booked"
},
{
"id": "0c64",
"userId": "9078563412",
"seats": [
"G1",
"G2",
"G3",
"G4"
],
"status": "booked"
} }
] ]
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"axios": "^1.9.0", "axios": "^1.9.0",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"fireworks-js": "^2.10.8",
"react": "^19.1.0", "react": "^19.1.0",
"react-dom": "^19.1.0", "react-dom": "^19.1.0",
"react-icons": "^5.5.0", "react-icons": "^5.5.0",
...@@ -2856,6 +2857,12 @@ ...@@ -2856,6 +2857,12 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/fireworks-js": {
"version": "2.10.8",
"resolved": "https://registry.npmjs.org/fireworks-js/-/fireworks-js-2.10.8.tgz",
"integrity": "sha512-UZNxeJvRmQzLisN4iriWXqKojG9TDJqc0dPmkUw0/+AEQQ3w8z1Jx2YdFSiBGSVb/u4dPTQXU109GMVblzhfpg==",
"license": "MIT"
},
"node_modules/flat-cache": { "node_modules/flat-cache": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"dependencies": { "dependencies": {
"axios": "^1.9.0", "axios": "^1.9.0",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"fireworks-js": "^2.10.8",
"react": "^19.1.0", "react": "^19.1.0",
"react-dom": "^19.1.0", "react-dom": "^19.1.0",
"react-icons": "^5.5.0", "react-icons": "^5.5.0",
......
src/Assets/Success.png

257 KB | W: | H:

src/Assets/Success.png

54.6 KB | W: | H:

src/Assets/Success.png
src/Assets/Success.png
src/Assets/Success.png
src/Assets/Success.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -4,6 +4,7 @@ export const Input = ({ ...@@ -4,6 +4,7 @@ export const Input = ({
onChange, onChange,
placeholder, placeholder,
type, type,
required,
icon: Icon, icon: Icon,
...props ...props
}) => { }) => {
...@@ -19,6 +20,7 @@ export const Input = ({ ...@@ -19,6 +20,7 @@ export const Input = ({
placeholder={placeholder} placeholder={placeholder}
type={type} type={type}
onChange={onChange} onChange={onChange}
required={required}
{...props} {...props}
/> />
</div> </div>
......
...@@ -21,8 +21,13 @@ export const Login = ({ onClick, onSwitch }) => { ...@@ -21,8 +21,13 @@ export const Login = ({ onClick, onSwitch }) => {
const HandleButton = (e) => { const HandleButton = (e) => {
e.preventDefault(); e.preventDefault();
if (!value) {
toast.info("Please Enter Your Number");
return;
}
if (!/^[6-9]\d{9}$/.test(value)) { if (!/^[6-9]\d{9}$/.test(value)) {
toast.info("Please enter a valid 10-digit number"); toast.info("Invalid Number");
return; return;
} }
if (value.length < 10) { if (value.length < 10) {
...@@ -52,6 +57,7 @@ export const Login = ({ onClick, onSwitch }) => { ...@@ -52,6 +57,7 @@ export const Login = ({ onClick, onSwitch }) => {
pattern="[6-9][0-9]{9}" pattern="[6-9][0-9]{9}"
min="0" min="0"
icon={FaPhoneAlt} icon={FaPhoneAlt}
required
/> />
</div> </div>
{islesser && ( {islesser && (
...@@ -61,7 +67,7 @@ export const Login = ({ onClick, onSwitch }) => { ...@@ -61,7 +67,7 @@ export const Login = ({ onClick, onSwitch }) => {
<Button <Button
children="Submit" children="Submit"
onClick={HandleButton} onClick={HandleButton}
disabled={value.trim().length === 0} // disabled={value.trim().length === 0}
/> />
<div className={styles.foot}> <div className={styles.foot}>
Don't have an account?{" "} Don't have an account?{" "}
......
// import styles from './Styles.module.css'; export const Header = ({ title, Color, className }) => {
return (
export const Header=({title,Color,className})=>{ <div className={className}>
return( <h2 style={{ color: Color }}>{title}</h2>
<div className={className}> </div>
<h2 style={{color:Color}}>{title}</h2> );
</div> };
)
}
...@@ -31,7 +31,7 @@ export const Summary = ({ success: propSuccess }) => { ...@@ -31,7 +31,7 @@ export const Summary = ({ success: propSuccess }) => {
<div className={styles.qrContainer}> <div className={styles.qrContainer}>
<img src={Success} alt="QR code" className={styles.qr} /> <img src={Success} alt="QR code" className={styles.qr} />
<p className={styles.qrNote}>Scan this QR code at the entrance</p> <p className={styles.qrNote}>Your Seat, Secured in Seconds</p>
</div> </div>
{bookingInfo && ( {bookingInfo && (
...@@ -51,7 +51,11 @@ export const Summary = ({ success: propSuccess }) => { ...@@ -51,7 +51,11 @@ export const Summary = ({ success: propSuccess }) => {
</div> </div>
</div> </div>
<div className={styles.row}> <div className={styles.row}>
<span className={styles.label}>User Number</span> <span className={styles.label}>Seat Number</span>
<span className={styles.value}>{bookingInfo.seats.length}</span>
</div>
<div className={styles.row}>
<span className={styles.label}>Mobile Number</span>
<span className={styles.value}>{bookingInfo.userId}</span> <span className={styles.value}>{bookingInfo.userId}</span>
</div> </div>
<div className={styles.row}> <div className={styles.row}>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
justify-content: center; justify-content: center;
min-height: 100vh; min-height: 100vh;
padding: 1rem; padding: 1rem;
margin: 1rem;
} }
.success { .success {
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
.seatWrapper { .seatWrapper {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.25rem; gap: 0.1rem;
margin-left: 2rem; margin-left: 2rem;
} }
...@@ -160,3 +161,9 @@ ...@@ -160,3 +161,9 @@
color: #6b7280; color: #6b7280;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
@media (min-width: 768px) {
.pageContainer {
margin: 0;
}
}
...@@ -5,7 +5,7 @@ import { Input } from "../../Form/form/Input"; ...@@ -5,7 +5,7 @@ import { Input } from "../../Form/form/Input";
import { Header } from "../../Layout/Card//Header"; import { Header } from "../../Layout/Card//Header";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
const Counter = ({ onSubmit, className, onChange }) => { const Counter = ({ onSubmit, className, onChange, onClick }) => {
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
console.log(onSubmit); console.log(onSubmit);
const Num = (e) => { const Num = (e) => {
...@@ -27,6 +27,9 @@ const Counter = ({ onSubmit, className, onChange }) => { ...@@ -27,6 +27,9 @@ const Counter = ({ onSubmit, className, onChange }) => {
} else { } else {
toast.info("no seats selected"); toast.info("no seats selected");
} }
if (onClick) {
onClick(count);
}
}; };
return ( return (
......
import Counter from "./Counter"; import Counter from "./Counter";
export default { export default {
title: "Top Level", title: "Top Level",
component: Counter, component: Counter,
...@@ -7,7 +6,7 @@ export default { ...@@ -7,7 +6,7 @@ export default {
layout: "centered", layout: "centered",
}, },
argTypes: { argTypes: {
onClick: { action: "Seat-Selecteds" }, onClick: { action: "Seat-Selected" },
}, },
}; };
......
import { SeatSelectionComponent } from "./Index"; import { SeatSelectionComponent } from "./Index";
export default { export default {
title: "Top-Level/Seat-Selection", title: "Top-Level/Seat-Selection",
component: SeatSelectionComponent, component: SeatSelectionComponent,
...@@ -12,8 +11,8 @@ export default { ...@@ -12,8 +11,8 @@ export default {
}; };
export const SeatSelection = { export const SeatSelection = {
args:{ args: {
seats:[ seats: [
[0, "A1", "A2", "A3", 0, "A4", "A5", "A6", 0], [0, "A1", "A2", "A3", 0, "A4", "A5", "A6", 0],
["B1", "B2", "B3", "B4", 0, "B5", "B6", "B7", "B8"], ["B1", "B2", "B3", "B4", 0, "B5", "B6", "B7", "B8"],
["C1", "C2", "C3", "C4", 0, "C5", "C6", "C7", "C8"], ["C1", "C2", "C3", "C4", 0, "C5", "C6", "C7", "C8"],
...@@ -23,8 +22,8 @@ export const SeatSelection = { ...@@ -23,8 +22,8 @@ export const SeatSelection = {
["G1", "G2", "G3", "G4", 0, "G5", "G6", "G7", "G8"], ["G1", "G2", "G3", "G4", 0, "G5", "G6", "G7", "G8"],
[0, "H1", "H2", "H3", 0, "H4", "H5", "H7", 0], [0, "H1", "H2", "H3", 0, "H4", "H5", "H7", 0],
], ],
seatLimit:2, seatLimit: 2,
reservedSeats:["A1"], reservedSeats: ["A1"],
selectedSeats:[], selectedSeats: [],
}, },
}; };
...@@ -47,7 +47,7 @@ export function ContextProvider({ children }) { ...@@ -47,7 +47,7 @@ export function ContextProvider({ children }) {
const existingUser = await api.loginUser(mobile); const existingUser = await api.loginUser(mobile);
if (existingUser) { if (existingUser) {
toast.error("Mobile number already registered. Please log in."); toast.info("You're registered! Log in instead");
navigate("/"); navigate("/");
return; return;
} }
......
...@@ -72,7 +72,7 @@ function SeatBooking() { ...@@ -72,7 +72,7 @@ function SeatBooking() {
try { try {
const validSeats = seats.filter((s) => typeof s === "string" && s.trim()); const validSeats = seats.filter((s) => typeof s === "string" && s.trim());
if (validSeats.length < initialLimit) { if (validSeats.length !== initialLimit) {
toast.info(`Please select ${initialLimit} seat(s).`); toast.info(`Please select ${initialLimit} seat(s).`);
return; return;
} }
...@@ -112,7 +112,7 @@ function SeatBooking() { ...@@ -112,7 +112,7 @@ function SeatBooking() {
sessionStorage.setItem("selectedSeats", JSON.stringify(validSeats)); sessionStorage.setItem("selectedSeats", JSON.stringify(validSeats));
if (typeof clearSelection === "function") clearSelection(); if (typeof clearSelection === "function") clearSelection();
navigate("/Ticket", { navigate("/ticket", {
state: { state: {
success: true, success: true,
bookingInfo: { bookingInfo: {
......
...@@ -3,6 +3,7 @@ import Counter from "../components/Top-level/Counter/Counter"; ...@@ -3,6 +3,7 @@ import Counter from "../components/Top-level/Counter/Counter";
import { useAppContext } from "../context/Index"; import { useAppContext } from "../context/Index";
import styles from "./Styles.module.css"; import styles from "./Styles.module.css";
import { MdEventSeat } from "react-icons/md"; import { MdEventSeat } from "react-icons/md";
import { Header } from "../components/Layout/Card/Header";
export const SeatLimit = () => { export const SeatLimit = () => {
const totalSeats = 60; const totalSeats = 60;
const { reservedSeats } = useAppContext(); const { reservedSeats } = useAppContext();
...@@ -17,7 +18,11 @@ export const SeatLimit = () => { ...@@ -17,7 +18,11 @@ export const SeatLimit = () => {
<> <>
<div className={styles.seat}> <div className={styles.seat}>
<MdEventSeat className={styles.icon} /> <MdEventSeat className={styles.icon} />
<p className={styles.line}>Remaining Seats Available: {Seat}</p> <Header
title={`Remaining Seats Available:${Seat}`}
Color="#fff"
className={styles.line}
/>
</div> </div>
<Counter onSubmit={handleSeat} /> <Counter onSubmit={handleSeat} />
</> </>
......
...@@ -40,11 +40,12 @@ ...@@ -40,11 +40,12 @@
.line { .line {
font-size: 1rem; font-size: 1rem;
color: #c7d2fe; color: #c7d2fe;
font-weight: 500; font-weight: 300;
margin-bottom: 1rem; margin-bottom: 1rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-left: 1rem; margin-left: 2.9rem;
flex-wrap: wrap;
} }
.line p { .line p {
text-align: center; text-align: center;
...@@ -52,8 +53,10 @@ ...@@ -52,8 +53,10 @@
.icon { .icon {
color: #fff; color: #fff;
position: absolute; position: absolute;
margin-left: 0.5rem; margin-left: 0;
margin-top: 4px; margin-top: 1rem;
height: 2rem;
width: 2rem;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
...@@ -71,9 +74,12 @@ ...@@ -71,9 +74,12 @@
min-width: 40rem; min-width: 40rem;
} }
.icon { .icon {
margin-left: 3.5rem; margin-left: 0.5rem;
margin-top: 0.3rem;
height: 1.5rem;
width: 1.5rem;
} }
.line { .line {
margin-left: 2rem; margin-left: 2.5rem;
} }
} }
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