From 2026b3ddc18b2841c479fb4770c20906b863f686 Mon Sep 17 00:00:00 2001 From: Ikki Date: Sun, 10 Nov 2024 18:16:29 +0530 Subject: [PATCH 1/2] success_story_page --- .../Pages/components/SuccessPage.jsx | 113 ++++++++++++++++++ frontend/src/MainContent.jsx | 2 + 2 files changed, 115 insertions(+) create mode 100644 frontend/src/AgroShopAI/components/Pages/components/SuccessPage.jsx diff --git a/frontend/src/AgroShopAI/components/Pages/components/SuccessPage.jsx b/frontend/src/AgroShopAI/components/Pages/components/SuccessPage.jsx new file mode 100644 index 00000000..7f0f98cf --- /dev/null +++ b/frontend/src/AgroShopAI/components/Pages/components/SuccessPage.jsx @@ -0,0 +1,113 @@ + + +import { useState } from 'react' + +const dummyStories = [ + { + id: 1, + name: "Vivek", + location: "New Delhi, India", + cropType: "Organic Vegetables", + technology: "Hydroponics", + summary: "Increased yield by 40% using hydroponic systems", + fullStory: "John Doe, a third-generation farmer from California, embraced hydroponic technology to grow organic vegetables. Despite initial challenges, he persevered and saw a 40% increase in yield within the first year. His success has inspired many local farmers to adopt sustainable practices.", + image: "https://media.istockphoto.com/id/1166954334/photo/portrait-of-happy-senior-farmer.jpg?s=612x612&w=0&k=20&c=dn2yLIXXkXSWTsv2HdEiJHqSyQhbNT77SHc0dxetUrI=" + }, + { + id: 2, + name: "Maria Garcia", + location: "Andalusia, Spain", + cropType: "Olive Trees", + technology: "Precision Agriculture", + summary: "Reduced water usage by 30% with precision irrigation", + fullStory: "Maria Garcia, an olive farmer from Andalusia, implemented precision agriculture techniques to optimize her irrigation systems. By using soil sensors and weather data, she reduced water usage by 30% while maintaining high-quality olive production. Her story showcases the power of technology in preserving traditional farming practices.", + image: "https://st5.depositphotos.com/4435155/66403/i/1600/depositphotos_664032036-stock-photo-portrait-female-farmer-who-cultivating.jpg" + }, + { + id: 3, + name: "Raj Patel", + location: "Gujarat, India", + cropType: "Cotton", + technology: "Organic Farming", + summary: "Transitioned to organic cotton, increasing profit margins", + fullStory: "Raj Patel, a cotton farmer from Gujarat, made the bold decision to transition to organic farming methods. Despite initial yield reductions, he persevered and saw increased profit margins due to premium pricing for organic cotton. His success has led to a community-wide shift towards sustainable farming practices in his region.", + image: "https://img.etimg.com/thumb/width-420,height-315,imgsize-23777,resizemode-75,msid-13090201/opinion/interviews/science-of-food-is-hijacked-to-highest-bidder-raj-patel/new-section/raj-patel.jpg" + } +] + +export default function FarmerSuccessStories() { + const [searchTerm, setSearchTerm] = useState('') + const [selectedStory, setSelectedStory] = useState(null) + + const filteredStories = dummyStories.filter(story => + story.name.toLowerCase().includes(searchTerm.toLowerCase()) || + story.location.toLowerCase().includes(searchTerm.toLowerCase()) || + story.cropType.toLowerCase().includes(searchTerm.toLowerCase()) || + story.technology.toLowerCase().includes(searchTerm.toLowerCase()) + ) + + return ( +
+
+
+

Farmer Success Stories

+
+
+ +
+
+

+ Discover inspiring stories of farmers who have embraced sustainable practices and innovative technologies to transform their agricultural journey. +

+
+ +
+ setSearchTerm(e.target.value)} + /> +
+ +
+ {filteredStories.map(story => ( +
+ {story.name} +
+

{story.name}

+

{story.location}

+

{story.cropType} | {story.technology}

+

{story.summary}

+ +
+
+ ))} +
+
+ + {selectedStory && ( +
+
+

{selectedStory.name}'s Story

+ {selectedStory.name} +

{selectedStory.fullStory}

+ +
+
+ )} + + +
+ ) +} \ No newline at end of file diff --git a/frontend/src/MainContent.jsx b/frontend/src/MainContent.jsx index 536ddcd4..91fc3611 100644 --- a/frontend/src/MainContent.jsx +++ b/frontend/src/MainContent.jsx @@ -106,6 +106,7 @@ import SupportPage from './AgroShopAI/components/Pages/TicketUser'; import RentSupportPage from './AgroRentAI/components/RentSupportPage'; import WarehouseInventory from './AgroShopAI/components/Pages/Admin-Warehouse'; +import FarmerSuccessStories from './AgroShopAI/components/Pages/components/SuccessPage'; @@ -234,6 +235,7 @@ const MainContent = () => { } /> } /> } /> + } /> {checkShop ? :