5 Commits

Author SHA1 Message Date
03ad91c7e3 Update src/app/cartContext.tsx 2026-06-13 02:45:47 +00:00
9073a8d6b0 Update src/app/page.tsx 2026-06-13 02:42:24 +00:00
e9c4a2a668 Add src/app/cartContext.tsx 2026-06-13 02:42:23 +00:00
fab2cbb6a4 Merge version_3 into main
Merge version_3 into main
2026-06-13 02:40:06 +00:00
a03812a384 Update src/app/page.tsx 2026-06-13 02:40:03 +00:00
2 changed files with 150 additions and 208 deletions

86
src/app/cartContext.tsx Normal file
View File

@@ -0,0 +1,86 @@
"use client";
import React, { createContext, useContext, useState, useEffect } from "react";
interface CartItem {
id: string;
name: string;
price: number;
imageSrc: string;
quantity: number;
}
interface CartContextType {
cartItems: CartItem[];
addToCart: (product: { id: string; name: string; price: string; imageSrc: string; imageAlt?: string }) => void;
removeFromCart: (id: string) => void;
updateQuantity: (id: string, quantity: number) => void;
clearCart: () => void;
totalPrice: number;
}
const CartContext = createContext<CartContextType | undefined>(undefined);
export const CartProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const [cartItems, setCartItems] = useState<CartItem[]>(() => {
// Load cart from localStorage on initial render
if (typeof window !== "undefined") {
const storedCart = localStorage.getItem("shopwel_cart");
if (storedCart) {
return JSON.parse(storedCart);
}
}
return [];
});
useEffect(() => {
// Save cart to localStorage whenever it changes
if (typeof window !== "undefined") {
localStorage.setItem("shopwel_cart", JSON.stringify(cartItems));
}
}, [cartItems]);
const addToCart = (product: { id: string; name: string; price: string; imageSrc: string; imageAlt?: string }) => {
setCartItems((prevItems) => {
const itemExists = prevItems.find((item) => item.id === product.id);
if (itemExists) {
return prevItems.map((item) =>
item.id === product.id ? { ...item, quantity: item.quantity + 1 } : item
);
} else {
const priceValue = parseFloat(product.price.replace("₹", "").replace("/kg", "").replace("/L", ""));
return [...prevItems, { ...product, price: priceValue, quantity: 1 }];
}
});
};
const removeFromCart = (id: string) => {
setCartItems((prevItems) => prevItems.filter((item) => item.id !== id));
};
const updateQuantity = (id: string, quantity: number) => {
setCartItems((prevItems) =>
prevItems.map((item) => (item.id === id ? { ...item, quantity: Math.max(1, quantity) } : item))
);
};
const clearCart = () => {
setCartItems([]);
};
const totalPrice = cartItems.reduce((total, item) => total + item.price * item.quantity, 0);
return (
<CartContext.Provider value={{ cartItems, addToCart, removeFromCart, updateQuantity, clearCart, totalPrice }}>
{children}
</CartContext.Provider>
);
};
export const useCart = () => {
const context = useContext(CartContext);
if (context === undefined) {
throw new Error("useCart must be used within a CartProvider");
}
return context;
};

View File

@@ -14,6 +14,23 @@ import SocialProofOne from '@/components/sections/socialProof/SocialProofOne';
import TestimonialCardOne from '@/components/sections/testimonial/TestimonialCardOne';
export default function LandingPage() {
const updatedNavItems = [
{
name: "Home", id: "#home"},
{
name: "About", id: "#about"},
{
name: "Products", id: "#products"},
{
name: "Orders", id: "/order-details"},
{
name: "Testimonials", id: "#testimonials"},
{
name: "FAQs", id: "#faqs"},
{
name: "Contact", id: "#contact"},
];
return (
<ThemeProvider
defaultButtonVariant="text-stagger"
@@ -30,58 +47,26 @@ export default function LandingPage() {
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarLayoutFloatingOverlay
navItems={[
{
name: "Home",
id: "#home",
},
{
name: "About",
id: "#about",
},
{
name: "Products",
id: "#products",
},
{
name: "Testimonials",
id: "#testimonials",
},
{
name: "FAQs",
id: "#faqs",
},
{
name: "Contact",
id: "#contact",
},
]}
navItems={updatedNavItems}
logoSrc="http://img.b2bpic.net/free-vector/green-supermarket-corporate-identity-logo-template_23-2148453180.jpg"
logoAlt="Shopwel Mart Logo"
brandName="Shopwel Mart"
button={{
text: "Shop Now",
href: "#products",
}}
text: "Shop Now", href: "#products"}}
/>
</div>
<div id="home" data-section="home">
<HeroLogoBillboard
background={{
variant: "radial-gradient",
}}
variant: "radial-gradient"}}
logoText="Shopwel Mart"
description="Your daily destination for fresh groceries, household essentials, and more. Quality and convenience at the heart of Bengaluru."
buttons={[
{
text: "Shop Now",
href: "#products",
},
text: "Shop Now", href: "#products"},
{
text: "Our Location",
href: "#contact",
},
text: "Our Location", href: "#contact"},
]}
imageSrc="http://img.b2bpic.net/free-photo/young-couple-choosing-goods-supermarket_23-2148150039.jpg"
imageAlt="Interior of a bustling grocery store with fresh produce"
@@ -106,29 +91,13 @@ export default function LandingPage() {
useInvertedBackground={true}
features={[
{
title: "Fresh Produce Daily",
description: "Locally sourced fruits and vegetables, delivered fresh every morning for unparalleled quality.",
imageSrc: "http://img.b2bpic.net/free-photo/abundance-fresh-healthy-fruits-market-generated-by-ai_188544-24226.jpg",
imageAlt: "Basket of fresh fruits and vegetables",
},
title: "Fresh Produce Daily", description: "Locally sourced fruits and vegetables, delivered fresh every morning for unparalleled quality.", imageSrc: "http://img.b2bpic.net/free-photo/abundance-fresh-healthy-fruits-market-generated-by-ai_188544-24226.jpg", imageAlt: "Basket of fresh fruits and vegetables"},
{
title: "Wide Selection",
description: "Discover a diverse range of products from daily essentials to gourmet treats and international items.",
imageSrc: "http://img.b2bpic.net/free-photo/abstract-blur-supermarket-department-store_74190-5230.jpg",
imageAlt: "Well-stocked grocery store aisles",
},
title: "Wide Selection", description: "Discover a diverse range of products from daily essentials to gourmet treats and international items.", imageSrc: "http://img.b2bpic.net/free-photo/abstract-blur-supermarket-department-store_74190-5230.jpg", imageAlt: "Well-stocked grocery store aisles"},
{
title: "Convenient Location",
description: "Easily accessible at Shanti Kunj, Vasanth Nagar, with ample parking and friendly neighborhood vibe.",
imageSrc: "http://img.b2bpic.net/free-photo/smiling-young-female-window-shopping_23-2147968448.jpg",
imageAlt: "Exterior of Shopwel Mart in Bengaluru",
},
title: "Convenient Location", description: "Easily accessible at Shanti Kunj, Vasanth Nagar, with ample parking and friendly neighborhood vibe.", imageSrc: "http://img.b2bpic.net/free-photo/smiling-young-female-window-shopping_23-2147968448.jpg", imageAlt: "Exterior of Shopwel Mart in Bengaluru"},
{
title: "Friendly Service",
description: "Our dedicated staff is always ready to assist you with a smile, ensuring a pleasant shopping trip.",
imageSrc: "http://img.b2bpic.net/free-photo/young-attractive-girls-electronics-store-use-laptop-exhibition_78826-3428.jpg",
imageAlt: "Shopwel Mart staff assisting a customer",
},
title: "Friendly Service", description: "Our dedicated staff is always ready to assist you with a smile, ensuring a pleasant shopping trip.", imageSrc: "http://img.b2bpic.net/free-photo/young-attractive-girls-electronics-store-use-laptop-exhibition_78826-3428.jpg", imageAlt: "Shopwel Mart staff assisting a customer"},
]}
title="Why Shop at Shopwel Mart?"
description="Experience the difference with our commitment to quality, variety, and customer satisfaction."
@@ -143,53 +112,17 @@ export default function LandingPage() {
useInvertedBackground={false}
products={[
{
id: "p1",
name: "Organic Carrots",
price: "₹60/kg",
variant: "Fresh Produce",
imageSrc: "http://img.b2bpic.net/free-photo/side-view-bowls-basket-vegetables-as-radish-onion-garlic-cloth-surface_141793-5664.jpg",
imageAlt: "Fresh organic carrots",
},
id: "p1", name: "Organic Carrots", price: "₹60/kg", variant: "Fresh Produce", imageSrc: "http://img.b2bpic.net/free-photo/side-view-bowls-basket-vegetables-as-radish-onion-garlic-cloth-surface_141793-5664.jpg", imageAlt: "Fresh organic carrots"},
{
id: "p2",
name: "Artisan Sourdough",
price: "₹150",
variant: "Baked Goods",
imageSrc: "http://img.b2bpic.net/free-photo/top-view-shot-cinnamon-rolls-tray-isolated-white-background_181624-57332.jpg",
imageAlt: "Artisan sourdough bread",
},
id: "p2", name: "Artisan Sourdough", price: "₹150", variant: "Baked Goods", imageSrc: "http://img.b2bpic.net/free-photo/top-view-shot-cinnamon-rolls-tray-isolated-white-background_181624-57332.jpg", imageAlt: "Artisan sourdough bread"},
{
id: "p3",
name: "Premium Olive Oil",
price: "₹499",
variant: "Gourmet Selection",
imageSrc: "http://img.b2bpic.net/free-photo/bread-olive-oil-with-salt-tray_23-2147853944.jpg",
imageAlt: "Bottle of premium olive oil",
},
id: "p3", name: "Premium Olive Oil", price: "₹499", variant: "Gourmet Selection", imageSrc: "http://img.b2bpic.net/free-photo/bread-olive-oil-with-salt-tray_23-2147853944.jpg", imageAlt: "Bottle of premium olive oil"},
{
id: "p4",
name: "Farm Fresh Milk",
price: "₹45/L",
variant: "Dairy Products",
imageSrc: "http://img.b2bpic.net/free-photo/close-up-man-with-bottle-goats-milk_23-2148673055.jpg",
imageAlt: "Carton of fresh milk",
},
id: "p4", name: "Farm Fresh Milk", price: "₹45/L", variant: "Dairy Products", imageSrc: "http://img.b2bpic.net/free-photo/close-up-man-with-bottle-goats-milk_23-2148673055.jpg", imageAlt: "Carton of fresh milk"},
{
id: "p5",
name: "Seasonal Fruit Basket",
price: "₹399",
variant: "Fresh Produce",
imageSrc: "http://img.b2bpic.net/free-photo/bunch-various-vegetables-out-wooden-basket_114579-56243.jpg",
imageAlt: "Basket of assorted seasonal fruits",
},
id: "p5", name: "Seasonal Fruit Basket", price: "₹399", variant: "Fresh Produce", imageSrc: "http://img.b2bpic.net/free-photo/bunch-various-vegetables-out-wooden-basket_114579-56243.jpg", imageAlt: "Basket of assorted seasonal fruits"},
{
id: "p6",
name: "Ethiopian Coffee Beans",
price: "₹650",
variant: "Beverages",
imageSrc: "http://img.b2bpic.net/free-photo/sackcloth-full-coffee-beans-coffee-beans-surface_176474-495.jpg",
imageAlt: "Bag of Ethiopian coffee beans",
},
id: "p6", name: "Ethiopian Coffee Beans", price: "₹650", variant: "Beverages", imageSrc: "http://img.b2bpic.net/free-photo/sackcloth-full-coffee-beans-coffee-beans-surface_176474-495.jpg", imageAlt: "Bag of Ethiopian coffee beans"},
]}
title="Our Bestsellers & New Arrivals"
description="Explore popular items and exciting new additions to our shelves, carefully curated for you."
@@ -204,50 +137,20 @@ export default function LandingPage() {
useInvertedBackground={true}
testimonials={[
{
id: "t1",
name: "Priya Sharma",
role: "Local Resident",
company: "Bengaluru",
rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/young-woman-with-fruit-her-hands-supermarket_169016-5033.jpg",
imageAlt: "Priya Sharma",
},
id: "t1", name: "Priya Sharma", role: "Local Resident", company: "Bengaluru", rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/young-woman-with-fruit-her-hands-supermarket_169016-5033.jpg", imageAlt: "Priya Sharma"},
{
id: "t2",
name: "Rahul Singh",
role: "IT Professional",
company: "Vasanth Nagar",
rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/businessman-dress-code-makes-thumb-up_114579-15932.jpg",
imageAlt: "Rahul Singh",
},
id: "t2", name: "Rahul Singh", role: "IT Professional", company: "Vasanth Nagar", rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/businessman-dress-code-makes-thumb-up_114579-15932.jpg", imageAlt: "Rahul Singh"},
{
id: "t3",
name: "Anjali Mehta",
role: "Homemaker",
company: "Shanti Kunj",
rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/pleasure-shopping_1098-2357.jpg",
imageAlt: "Anjali Mehta",
},
id: "t3", name: "Anjali Mehta", role: "Homemaker", company: "Shanti Kunj", rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/pleasure-shopping_1098-2357.jpg", imageAlt: "Anjali Mehta"},
{
id: "t4",
name: "The Kumar Family",
role: "Customers",
company: "Bengaluru",
rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/beautiful-young-women-checking-shopping-bags_23-2148385650.jpg",
imageAlt: "The Kumar Family",
},
id: "t4", name: "The Kumar Family", role: "Customers", company: "Bengaluru", rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/beautiful-young-women-checking-shopping-bags_23-2148385650.jpg", imageAlt: "The Kumar Family"},
{
id: "t5",
name: "Dr. R. Gopal",
role: "Retired Professor",
company: "Vasanth Nagar",
rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/close-up-young-man-food-market_23-2149082594.jpg",
imageAlt: "Dr. R. Gopal",
},
id: "t5", name: "Dr. R. Gopal", role: "Retired Professor", company: "Vasanth Nagar", rating: 5,
imageSrc: "http://img.b2bpic.net/free-photo/close-up-young-man-food-market_23-2149082594.jpg", imageAlt: "Dr. R. Gopal"},
]}
title="What Our Customers Say"
description="Hear directly from our happy shoppers who love the Shopwel Mart experience and keep coming back."
@@ -259,14 +162,7 @@ export default function LandingPage() {
textboxLayout="default"
useInvertedBackground={false}
names={[
"Farm Fresh Organics",
"Daily Bakes",
"Pure Dairy Co.",
"Home Essentials",
"Nutri Foods",
"Aroma Coffee",
"Green Earth Products",
]}
"Farm Fresh Organics", "Daily Bakes", "Pure Dairy Co.", "Home Essentials", "Nutri Foods", "Aroma Coffee", "Green Earth Products"]}
title="Our Valued Partners"
description="Proudly working with leading local and national brands to bring you the best quality products for your daily needs."
/>
@@ -278,25 +174,13 @@ export default function LandingPage() {
useInvertedBackground={true}
faqs={[
{
id: "faq1",
title: "What are your operating hours?",
content: "Shopwel Mart is open from 8:00 AM to 9:00 PM, Monday through Sunday, for your convenience.",
},
id: "faq1", title: "What are your operating hours?", content: "Shopwel Mart is open from 8:00 AM to 9:00 PM, Monday through Sunday, for your convenience."},
{
id: "faq2",
title: "Do you offer home delivery?",
content: "Currently, we do not offer home delivery, but we are working on introducing this service soon. Please visit our store for your shopping needs.",
},
id: "faq2", title: "Do you offer home delivery?", content: "Currently, we do not offer home delivery, but we are working on introducing this service soon. Please visit our store for your shopping needs."},
{
id: "faq3",
title: "What is your return policy?",
content: "We accept returns of unused and unopened items within 7 days of purchase, with a valid receipt. Fresh produce returns must be made within 24 hours.",
},
id: "faq3", title: "What is your return policy?", content: "We accept returns of unused and unopened items within 7 days of purchase, with a valid receipt. Fresh produce returns must be made within 24 hours."},
{
id: "faq4",
title: "Are there any special discounts for bulk purchases?",
content: "Yes, we offer special discounts for bulk purchases on select items. Please speak to our store manager for more details on available offers.",
},
id: "faq4", title: "Are there any special discounts for bulk purchases?", content: "Yes, we offer special discounts for bulk purchases on select items. Please speak to our store manager for more details on available offers."},
]}
title="Frequently Asked Questions"
description="Find quick answers to common questions about shopping at Shopwel Mart, from our operating hours to return policies."
@@ -308,14 +192,11 @@ export default function LandingPage() {
<ContactText
useInvertedBackground={false}
background={{
variant: "radial-gradient",
}}
variant: "radial-gradient"}}
text="Visit Us Today at Shopwel Mart! Experience quality and convenience at our prime location in Bengaluru: Shanti Kunj, 75/1, Abshot Layout, Vasanth Nagar, Bengaluru, Karnataka 560001. We look forward to serving you!"
buttons={[
{
text: "Get Directions",
href: "https://maps.app.goo.gl/YourGoogleMapsLinkHere",
},
text: "Get Directions", href: "https://maps.app.goo.gl/YourGoogleMapsLinkHere"},
]}
/>
</div>
@@ -325,62 +206,37 @@ export default function LandingPage() {
logoText="Shopwel Mart"
columns={[
{
title: "Categories",
items: [
title: "Categories", items: [
{
label: "Fresh Produce",
href: "#products",
},
label: "Fresh Produce", href: "#products"},
{
label: "Groceries",
href: "#products",
},
label: "Groceries", href: "#products"},
{
label: "Household",
href: "#products",
},
label: "Household", href: "#products"},
{
label: "Dairy & Bakery",
href: "#products",
},
label: "Dairy & Bakery", href: "#products"},
],
},
{
title: "About Us",
items: [
title: "About Us", items: [
{
label: "Our Story",
href: "#about",
},
label: "Our Story", href: "#about"},
{
label: "Why Shopwel",
href: "#features",
},
label: "Why Shopwel", href: "#features"},
{
label: "Customer Reviews",
href: "#testimonials",
},
label: "Customer Reviews", href: "#testimonials"},
],
},
{
title: "Connect",
items: [
title: "Connect", items: [
{
label: "Location",
href: "#contact",
},
label: "Location", href: "#contact"},
{
label: "FAQs",
href: "#faqs",
},
label: "FAQs", href: "#faqs"},
{
label: "Privacy Policy",
href: "#",
},
label: "Privacy Policy", href: "#"},
{
label: "Terms of Service",
href: "#",
},
label: "Terms of Service", href: "#"},
],
},
]}
@@ -390,4 +246,4 @@ export default function LandingPage() {
</ReactLenis>
</ThemeProvider>
);
}
}