Skip to content

Commit c830f00

Browse files
2 parents 3848e8f + 7bd9798 commit c830f00

File tree

1 file changed

+1
-78
lines changed

1 file changed

+1
-78
lines changed

frontend/src/pages/Home.jsx

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const Home = () => {
1818
const [showFilters, setShowFilters] = useState(false);
1919
const [viewMode, setViewMode] = useFormPersistence('home_view', 'grid'); // 'grid' or 'list'
2020
const [isScrolled, setIsScrolled] = useState(false);
21-
const [showHowItWorksModal, setShowHowItWorksModal] = useState(false);
2221
const isInitialLoad = useRef(true);
2322
const itemsContainerRef = useRef(null);
2423

@@ -137,14 +136,6 @@ const Home = () => {
137136
scrollToItems();
138137
};
139138

140-
const handleHowItWorksClick = () => {
141-
if (isScrolled) {
142-
setShowHowItWorksModal(true);
143-
} else {
144-
navigate('/how-it-works');
145-
}
146-
};
147-
148139
return (
149140
<div className={`min-h-screen transition-colors duration-300 ${darkMode ? 'bg-slate-900' : 'bg-gray-50'}`}>
150141
{/* Animated How It Works Button - slides in from left */}
@@ -160,7 +151,7 @@ const Home = () => {
160151
className="fixed top-16 sm:top-20 left-2 sm:left-4 z-40"
161152
>
162153
<motion.button
163-
onClick={handleHowItWorksClick}
154+
onClick={() => navigate('/how-it-works')}
164155
animate={{
165156
paddingLeft: isScrolled ? 10 : 12,
166157
paddingRight: isScrolled ? 10 : 12,
@@ -198,74 +189,6 @@ const Home = () => {
198189
</motion.button>
199190
</motion.div>
200191

201-
{/* How It Works Modal */}
202-
{showHowItWorksModal && (
203-
<div
204-
className="fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-2 sm:p-4"
205-
onClick={() => setShowHowItWorksModal(false)}
206-
>
207-
<motion.div
208-
initial={{ opacity: 0, scale: 0.95 }}
209-
animate={{ opacity: 1, scale: 1 }}
210-
exit={{ opacity: 0, scale: 0.95 }}
211-
onClick={(e) => e.stopPropagation()}
212-
className={`rounded-xl w-full max-w-2xl max-h-[85vh] sm:max-h-[80vh] overflow-y-auto ${
213-
darkMode ? 'bg-gray-900' : 'bg-white'
214-
}`}
215-
>
216-
<div className={`sticky top-0 flex justify-between items-center p-3 sm:p-6 border-b ${
217-
darkMode ? 'bg-gray-900 border-gray-700' : 'bg-white border-gray-300'
218-
}`}>
219-
<h2 className={`text-lg sm:text-2xl font-bold ${darkMode ? 'text-white' : 'text-gray-900'}`}>
220-
How It Works
221-
</h2>
222-
<button
223-
onClick={() => setShowHowItWorksModal(false)}
224-
className={`p-1.5 sm:p-2 hover:bg-gray-200 dark:hover:bg-gray-800 rounded-lg transition-colors`}
225-
>
226-
<X className="w-5 h-5 sm:w-6 sm:h-6" />
227-
</button>
228-
</div>
229-
<div className={`p-3 sm:p-6 ${darkMode ? 'text-gray-300' : 'text-gray-700'}`}>
230-
<div className="grid grid-cols-1 gap-4 sm:gap-6">
231-
{/* Why We Built This Card */}
232-
<div className={`p-3 sm:p-4 rounded-lg ${darkMode ? 'bg-gray-800' : 'bg-gray-100'}`}>
233-
<h3 className={`text-base sm:text-xl font-bold mb-2 sm:mb-3 ${darkMode ? 'text-indigo-400' : 'text-indigo-600'}`}>
234-
🔎 Why We Built This
235-
</h3>
236-
<p className="text-xs sm:text-sm mb-2">
237-
Historically, campus-wide <span className="font-semibold">lost-and-found updates</span> were sent as <span className="font-semibold">mass emails</span>. This <span className="font-semibold">clutters inboxes</span>.
238-
</p>
239-
<p className="text-xs sm:text-sm mb-2">
240-
This portal centralizes found-item listings, resulting in <span className="font-semibold">less inbox noise</span> and clearer matching.
241-
</p>
242-
<p className="text-xs sm:text-sm">
243-
<strong>⚠️ Important:</strong> Avoid sharing detailed photos of lost items in mass emails. Use this portal to keep sensitive information secure.
244-
</p>
245-
</div>
246-
247-
{/* Overview Card */}
248-
<div className={`p-3 sm:p-4 rounded-lg ${darkMode ? 'bg-gray-800' : 'bg-gray-100'}`}>
249-
<h3 className={`text-base sm:text-xl font-bold mb-2 sm:mb-3 ${darkMode ? 'text-indigo-400' : 'text-indigo-600'}`}>
250-
📋 Overview
251-
</h3>
252-
<p className="text-xs sm:text-sm mb-2">
253-
This portal is managed by Thapar University administration. <span className="font-semibold">📌 Only items physically deposited with the campus guard or admin are listed here.</span>
254-
</p>
255-
<p className="text-xs sm:text-sm mb-2 sm:mb-3">
256-
If you find an item, <span className="font-semibold">please hand it over to the campus guard or admin</span>.
257-
</p>
258-
<div className={`text-xs p-2 rounded border-l-4 ${darkMode ? 'bg-gray-700 border-indigo-400' : 'bg-indigo-50 border-indigo-600'}`}>
259-
<p><span className="font-bold">🔔 Important:</span> It is <span className="font-semibold">your responsibility</span> to check the portal and apply for a claim if you have lost something.</p>
260-
</div>
261-
</div>
262-
</div>
263-
</div>
264-
</motion.div>
265-
</div>
266-
)}
267-
268-
269192
<div className="px-4 sm:px-6 md:px-8 lg:px-16 xl:px-24 py-12">
270193
{/* Hero Section */}
271194
<div className="text-center mb-16 mt-8">

0 commit comments

Comments
 (0)