Update src/app/page.tsx
This commit is contained in:
@@ -16,10 +16,11 @@ export default function LandingPage() {
|
||||
const [isReserving, setIsReserving] = useState(false);
|
||||
const [email, setEmail] = useState("");
|
||||
const [mobile, setMobile] = useState("");
|
||||
const [name, setName] = useState("");
|
||||
const [guests, setGuests] = useState("2");
|
||||
|
||||
const handleReserve = () => {
|
||||
const message = encodeURIComponent(`Hello, I would like to book a table at Shaffa. \nEmail: ${email}\nMobile: ${mobile}\nGuests: ${guests}`);
|
||||
const message = encodeURIComponent(`Hello, I would like to book a table at Shaffa. \nName: ${name}\nEmail: ${email}\nMobile: ${mobile}\nGuests: ${guests}`);
|
||||
window.open(`https://wa.me/919876543210?text=${message}`, '_blank');
|
||||
setIsReserving(false);
|
||||
};
|
||||
@@ -47,7 +48,7 @@ export default function LandingPage() {
|
||||
{ name: "Contact", id: "contact" },
|
||||
]}
|
||||
button={{
|
||||
text: "Reserve", onClick: () => setIsReserving(true)
|
||||
text: "Book a table", onClick: () => setIsReserving(true)
|
||||
}}
|
||||
brandName="Shaffa"
|
||||
/>
|
||||
@@ -59,7 +60,7 @@ export default function LandingPage() {
|
||||
description="Authentic flavors of North India, crafted for families and couples in the heart of Sec 26B, Chandigarh."
|
||||
buttons={[
|
||||
{
|
||||
text: "Reserve on WhatsApp", onClick: () => setIsReserving(true),
|
||||
text: "Book a table", onClick: () => setIsReserving(true),
|
||||
},
|
||||
]}
|
||||
imageSrc="http://img.b2bpic.net/free-photo/vegetable-salad-with-herbs-cheese_140725-44342.jpg?_wi=1"
|
||||
@@ -70,7 +71,13 @@ export default function LandingPage() {
|
||||
{isReserving && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4">
|
||||
<div className="bg-white p-8 rounded-lg shadow-xl w-full max-w-sm">
|
||||
<h2 className="text-xl font-bold mb-4 text-black">Confirm Your Reservation</h2>
|
||||
<h2 className="text-xl font-bold mb-4 text-black">Book a Table</h2>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Full Name"
|
||||
className="w-full p-2 mb-4 border rounded text-black"
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Email Address"
|
||||
@@ -83,16 +90,9 @@ export default function LandingPage() {
|
||||
className="w-full p-2 mb-4 border rounded text-black"
|
||||
onChange={(e) => setMobile(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
placeholder="Number of Guests"
|
||||
className="w-full p-2 mb-4 border rounded text-black"
|
||||
value={guests}
|
||||
onChange={(e) => setGuests(e.target.value)}
|
||||
/>
|
||||
<div className="flex gap-2">
|
||||
<button onClick={() => setIsReserving(false)} className="flex-1 p-2 bg-gray-200 rounded">Cancel</button>
|
||||
<button onClick={handleReserve} className="flex-1 p-2 bg-blue-600 text-white rounded">Send to WhatsApp</button>
|
||||
<button onClick={() => setIsReserving(false)} className="flex-1 p-2 bg-gray-200 rounded text-black">Cancel</button>
|
||||
<button onClick={handleReserve} className="flex-1 p-2 bg-blue-600 text-white rounded">Confirm Reservation</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,6 +104,9 @@ export default function LandingPage() {
|
||||
textboxLayout="default"
|
||||
gridVariant="three-columns-all-equal-width"
|
||||
useInvertedBackground={false}
|
||||
buttons={[
|
||||
{ text: "Reserve on WhatsApp", onClick: () => setIsReserving(true) }
|
||||
]}
|
||||
products={[
|
||||
{ id: "m1", name: "Butter Chicken", price: "₹450", variant: "Popular", imageSrc: "http://img.b2bpic.net/free-photo/top-close-view-delicious-bright-cake-with-cream-cracker-cookies-dark-wall-cake-biscuit-pie-sugar-sweet-photo-cookie_140725-53987.jpg?_wi=1" },
|
||||
{ id: "m2", name: "Tandoori Platter", price: "₹650", variant: "Premium", imageSrc: "http://img.b2bpic.net/free-photo/top-view-assortment-different-pakistan-goodies_23-2148821568.jpg?_wi=1" },
|
||||
|
||||
Reference in New Issue
Block a user