Skip to content

Commit

Permalink
✨ Update Home Page
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdra committed Oct 14, 2024
1 parent 14753cc commit 3f1d7bb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
24 changes: 16 additions & 8 deletions frontend/src/Components/Home/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { Search } from 'lucide-react'

const Hero = () => {
const scrollToShopList = () => {
const shopListSection = document.getElementById('shop-list')
if (shopListSection) {
shopListSection.scrollIntoView({ behavior: 'smooth' })
}
}

return (
<div>
<div className="absolute inset-0 -z-10 h-full w-full bg-white bg-[linear-gradient(to_right,#8080800a_1px,transparent_1px),linear-gradient(to_bottom,#8080800a_1px,transparent_1px)] bg-[size:14px_24px]">
Expand All @@ -9,17 +16,18 @@ const Hero = () => {
<div className="max-w-5xl mx-auto h-[60vh] ">
<div className="flex flex-col justify-center md:py-[6rem] text-center gap-y-8">
<h1 className=" bg-[#f3ffc6] border border-[#b8f724] max-w-3xl mx-auto px-10 rounded-full py-1">
Best Food , Best Price & Guaranteed at your fingertips
Best Food, Best Price & Guaranteed at your fingertips
</h1>
<h1 className="text-5xl ">
FRESH FRUIT , VEGETABLE & SPICES <br />
<h1 className="text-5xl">
FRESH FRUIT, VEGETABLE & SPICES <br />
BOX DELIVERY AT PRICES YOU&apos;ll LOVE
</h1>
<div className="max-w-5xl px-10 py-3 mx-auto border-2 rounded-full border-[#99DD05] flex items-center gap-3 hover:bg-[#f5fce6] hover:cursor-pointer">
<a href="/shops" className="flex items-center ">
<Search size={20} />
Explore the your marketplace
</a>
<div
className="max-w-5xl px-10 py-3 mx-auto border-2 rounded-full border-[#99DD05] flex items-center gap-3 hover:bg-[#f5fce6] hover:cursor-pointer"
onClick={scrollToShopList} // Trigger smooth scroll
>
<Search size={20} />
Explore your marketplace
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Home/ShopList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const ShopList = () => {
}

return (
<div className="mx-auto max-w-7xl py-[5rem]">
<div id="shop-list" className="mx-auto max-w-7xl py-[5rem]">
<h1 className="pb-10 text-4xl">Shop List</h1>
<div className="grid grid-cols-1 gap-6 md:grid-cols-4">
{shops.map((shop, index) => (
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/Pages/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,33 @@ import ProcessCTA from '../Components/Home/ProcessCTA'
import ShopList from '../Components/Home/ShopList'
import Testimonials from '../Components/Home/Testimonials'
import Footer from '../Components/Home/Footer'
import HelpChatIcon from '../Components/Help/HelpChatIcon'

const Homepage = () => {
useEffect(() => {
document.title = 'FarmCart : Home'
}, [])

const user = JSON.parse(localStorage.getItem('user'))

// Handle the case where user is null or undefined
const customer = user
? {
id: user._id,
name: user.firstname,
email: user.email,
createdAt: Date.now(),
}
: {
id: '01JA3JDNTD35GP144D83PPJVR6',
name: 'Guest',
email: 'guest@example.com',
createdAt: Date.now(),
}

return (
<>
<HelpChatIcon user={customer} />
<Hero />
<CTABar />
<ProcessCTA />
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/lib/constants/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ export const process = [
{
id: '01',
title: 'Choose Your Product',
desc: 'Explore a wide variety of products tailored to your needs. Simply browse, select your favorites, and add them to your cart.',
desc: 'Explore a wide variety of fresh produce, groceries, and more tailored to your preferences. Easily browse, pick your favorites, and add them to your personalized cart.',
},
{
id: '02',
title: 'Checkout',
desc: 'Review your selected items, ensure your details are correct, and proceed with our secure checkout process for a seamless experience.',
desc: 'Double-check your selected items and ensure your details are up-to-date before proceeding with our secure and hassle-free checkout process.',
},
{
id: '03',
title: 'Making your own box',
desc: "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a t",
title: 'Making Your Own Box',
desc: 'Create your own custom box filled with products you love. Mix and match items to build a personalized selection that fits your lifestyle.',
},
{
id: '04',
title: 'Delivering',
desc: 'Your order is on the way! We ensure timely and careful delivery to make sure your products arrive in perfect condition.',
desc: 'Once your order is confirmed, it’s prepared for shipment. Our reliable delivery service ensures your products reach you swiftly and safely.',
},
{
id: '05',
title: 'In Your Hands',
desc: 'Receive your order right at your doorstep. Unbox and enjoy your products, knowing they’ve been delivered with care.',
desc: 'Receive your order at your doorstep, open your box, and enjoy your carefully selected items. We ensure everything arrives in perfect condition.',
},
]

Expand Down

0 comments on commit 3f1d7bb

Please sign in to comment.