Fix formatting
This commit is contained in:
@@ -8,8 +8,6 @@ import { TopBar } from "@/components/ui/topbar";
|
|||||||
|
|
||||||
const API_URL = "";
|
const API_URL = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type MenuOptions = {
|
type MenuOptions = {
|
||||||
foetelek: string[];
|
foetelek: string[];
|
||||||
levesek: string[];
|
levesek: string[];
|
||||||
@@ -110,7 +108,7 @@ export default function HomePage() {
|
|||||||
} else {
|
} else {
|
||||||
const ord: Order = msg;
|
const ord: Order = msg;
|
||||||
setOrders((prev) => {
|
setOrders((prev) => {
|
||||||
const filtered = prev.filter(o => o.username !== ord.username);
|
const filtered = prev.filter((o) => o.username !== ord.username);
|
||||||
return [ord, ...filtered];
|
return [ord, ...filtered];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -119,8 +117,6 @@ export default function HomePage() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
es.onerror = (err) => {
|
es.onerror = (err) => {
|
||||||
console.error("SSE connection lost ❌", err);
|
console.error("SSE connection lost ❌", err);
|
||||||
es.close();
|
es.close();
|
||||||
@@ -132,8 +128,6 @@ export default function HomePage() {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!username) return null;
|
if (!username) return null;
|
||||||
|
|
||||||
const handleSubmit = async (e: FormEvent) => {
|
const handleSubmit = async (e: FormEvent) => {
|
||||||
@@ -168,7 +162,6 @@ export default function HomePage() {
|
|||||||
setMain("");
|
setMain("");
|
||||||
setSide("");
|
setSide("");
|
||||||
router.push("/landing");
|
router.push("/landing");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setError("Nem sikerült menteni a rendelést.");
|
setError("Nem sikerült menteni a rendelést.");
|
||||||
setSuccess(null);
|
setSuccess(null);
|
||||||
@@ -185,39 +178,54 @@ export default function HomePage() {
|
|||||||
No?... Mit együnk?
|
No?... Mit együnk?
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{menu ? (
|
{menu ? (
|
||||||
<form onSubmit={handleSubmit} className="w-full max-w-6xl space-y-6">
|
<form onSubmit={handleSubmit} className="w-full max-w-6xl space-y-6">
|
||||||
{/* Selection panels */}
|
{/* Selection panels */}
|
||||||
<div className="flex flex-col md:flex-row gap-6 items-start">
|
<div className="flex flex-col md:flex-row gap-6 items-start">
|
||||||
<div className="flex flex-col w-full md:w-1/3">
|
<div className="flex flex-col w-full md:w-1/3">
|
||||||
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">Levesek</h2>
|
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">
|
||||||
|
Levesek
|
||||||
|
</h2>
|
||||||
<Card className="glass-panel flex flex-col">
|
<Card className="glass-panel flex flex-col">
|
||||||
<CardContent className="pb-1 pt-5">
|
<CardContent className="pb-1 pt-5">
|
||||||
<FoodList items={menu.levesek} onSelect={setSoup} selected={soup} />
|
<FoodList
|
||||||
|
items={menu.levesek}
|
||||||
|
onSelect={setSoup}
|
||||||
|
selected={soup}
|
||||||
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col w-full md:w-1/3">
|
<div className="flex flex-col w-full md:w-1/3">
|
||||||
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">Főételek</h2>
|
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">
|
||||||
|
Főételek
|
||||||
|
</h2>
|
||||||
<Card className="glass-panel flex flex-col">
|
<Card className="glass-panel flex flex-col">
|
||||||
<CardContent className="pb-1 pt-5">
|
<CardContent className="pb-1 pt-5">
|
||||||
<FoodList items={menu.foetelek} onSelect={setMain} selected={main} />
|
<FoodList
|
||||||
|
items={menu.foetelek}
|
||||||
|
onSelect={setMain}
|
||||||
|
selected={main}
|
||||||
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="flex flex-col w-full md:w-1/3">
|
<div className="flex flex-col w-full md:w-1/3">
|
||||||
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">Köretek</h2>
|
<h2 className="text-center text-2xl sm:text-3xl text-white mb-2">
|
||||||
|
Köretek
|
||||||
|
</h2>
|
||||||
<Card className="glass-panel flex flex-col">
|
<Card className="glass-panel flex flex-col">
|
||||||
<CardContent className="pb-1 pt-5">
|
<CardContent className="pb-1 pt-5">
|
||||||
<FoodList items={menu.koretek} onSelect={setSide} selected={side} />
|
<FoodList
|
||||||
|
items={menu.koretek}
|
||||||
|
onSelect={setSide}
|
||||||
|
selected={side}
|
||||||
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* My Choice */}
|
{/* My Choice */}
|
||||||
@@ -229,14 +237,25 @@ export default function HomePage() {
|
|||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="text-white text-center space-y-2">
|
<CardContent className="text-white text-center space-y-2">
|
||||||
{soup && <p><strong>Leves:</strong> {soup}</p>}
|
{soup && (
|
||||||
|
<p>
|
||||||
|
<strong>Leves:</strong> {soup}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{(main || side) && (
|
{(main || side) && (
|
||||||
<p><strong>Második:</strong> {[main, side].filter(Boolean).join(", ")}</p>
|
<p>
|
||||||
|
<strong>Második:</strong>{" "}
|
||||||
|
{[main, side].filter(Boolean).join(", ")}
|
||||||
|
</p>
|
||||||
)}
|
)}
|
||||||
{!soup && !main && !side && <p>–</p>}
|
{!soup && !main && !side && <p>–</p>}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardContent className="flex flex-col items-center w-full pt-3 pb-4">
|
<CardContent className="flex flex-col items-center w-full pt-3 pb-4">
|
||||||
<Button type="submit" variant="food" className="w-full sm:w-1/3 lg:w-1/3">
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="food"
|
||||||
|
className="w-full sm:w-1/3 lg:w-1/3"
|
||||||
|
>
|
||||||
Mehet!
|
Mehet!
|
||||||
</Button>
|
</Button>
|
||||||
{error && (
|
{error && (
|
||||||
@@ -252,7 +271,6 @@ export default function HomePage() {
|
|||||||
) : (
|
) : (
|
||||||
<p className="text-white">Étlap betöltése…</p>
|
<p className="text-white">Étlap betöltése…</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user