From 21e16b71e34e52529996aec39ae3702e0f9a00bc Mon Sep 17 00:00:00 2001 From: Prachi0306 Date: Wed, 29 Oct 2025 12:44:53 +0530 Subject: [PATCH 1/4] added search bar --- package-lock.json | 12 -- src/app/dashboard/page.tsx | 337 ++++++++++++++++--------------------- src/components/button.tsx | 2 +- src/components/nav.tsx | 261 +++++++++++++++++----------- src/data/mockProjects.ts | 95 +++++++++++ src/lib/supabaseclient.ts | 12 +- 6 files changed, 416 insertions(+), 303 deletions(-) create mode 100644 src/data/mockProjects.ts diff --git a/package-lock.json b/package-lock.json index 97afd30..58fb027 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3071,7 +3071,6 @@ "integrity": "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -3082,7 +3081,6 @@ "integrity": "sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==", "devOptional": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^19.0.0" } @@ -3149,7 +3147,6 @@ "integrity": "sha512-4O3idHxhyzjClSMJ0a29AcoK0+YwnEqzI6oz3vlRf3xw0zbzt15MzXwItOlnr5nIth6zlY2RENLsOPvhyrKAQA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.34.1", "@typescript-eslint/types": "8.34.1", @@ -3666,7 +3663,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4086,7 +4082,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001718", "electron-to-chromium": "^1.5.160", @@ -4764,7 +4759,6 @@ "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -4938,7 +4932,6 @@ "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -7503,7 +7496,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -7696,7 +7688,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -7706,7 +7697,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.26.0" }, @@ -8544,7 +8534,6 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8710,7 +8699,6 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index c23d9eb..c9cc5d7 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -7,8 +7,8 @@ import { useRouter } from "next/navigation"; import { NavbarDemo } from "@/components/nav"; import { AnimatePresence } from "framer-motion"; import AcademicHubSkeleton from "@/components/skeletons/dashboardPageSkeleton"; +import { MOCK_PROJECTS } from "@/data/mockProjects"; -// Magic Card Component (from main) const MagicCard = ({ children, className = "", @@ -38,24 +38,20 @@ const MagicCard = ({ className={`relative overflow-hidden ${className}`} style={{ position: "relative" }} > - {/* Border highlight effect */} {isHovered && (
)} - {/* Inner glow effect */} {isHovered && (
{ const router = useRouter(); const [isLoading, setIsLoading] = useState(false); + const [searchQuery, setSearchQuery] = useState(""); - const featuredProjects = [ + const allProjects = [ { id: 1, title: "Assignment-Med", @@ -86,6 +83,7 @@ const AcademicHub = () => { originalPrice: 200, tag: "Best Seller", tagColor: "bg-amber-500", + tags: ["handwritten", "plagiarism-free", "on-time", "assignments"], }, { id: 2, @@ -99,6 +97,7 @@ const AcademicHub = () => { originalPrice: 400, tag: "New", tagColor: "bg-emerald-500", + tags: ["expert-guidance", "plagiarism-free", "termwork"], }, { id: 3, @@ -112,6 +111,7 @@ const AcademicHub = () => { originalPrice: 100, tag: "Popular", tagColor: "bg-blue-500", + tags: ["professional", "custom-design", "presentations", "ppt"], }, { id: 4, @@ -125,9 +125,37 @@ const AcademicHub = () => { originalPrice: 0, tag: "Free", tagColor: "bg-green-500", + tags: ["ai", "generator", "free", "instant"], }, + ...MOCK_PROJECTS.map((project, index) => ({ + id: index + 5, + title: project.title, + category: project.category, + level: project.level, + rating: project.rating, + reviews: project.reviews, + duration: project.deliveryTime, + price: project.price, + originalPrice: project.price * 2, + tag: project.badge || "Available", + tagColor: project.badge === "Best Seller" ? "bg-amber-500" : + project.badge === "New" ? "bg-emerald-500" : + project.badge === "Popular" ? "bg-blue-500" : "bg-gray-500", + tags: project.tags, + })) ]; + const filteredProjects = allProjects.filter((project) => { + if (!searchQuery.trim()) return true; + const query = searchQuery.toLowerCase(); + return ( + project.title.toLowerCase().includes(query) || + project.category.toLowerCase().includes(query) || + project.level.toLowerCase().includes(query) || + project.tags.some((tag) => tag.toLowerCase().includes(query)) + ); + }); + const stats = [ { number: "0%", label: "Plagiarism" }, { number: "5K+", label: "Projects Delivered" }, @@ -139,18 +167,11 @@ const AcademicHub = () => { return (
- {/* Loading Screen (from your branch) */} {isLoading && } -
- {/* Navbar */} - +
+ - {/* Hero Section (single) */}
@@ -161,9 +182,7 @@ const AcademicHub = () => {

- Get high-quality assignments, projects, and research papers - crafted by experts. Boost your academic performance with our - premium collection. + Get high-quality assignments, projects, and research papers crafted by experts. Boost your academic performance with our premium collection.

- {/* Featured Projects (MagicCard + your Shop Now button) */}
-
+

Featured Projects

-
- {featuredProjects.map((project) => ( - -
- - {project.tag} - -
- -
- {project.id === 1 && ( - Assignment - )} - {project.id === 2 && ( - Termwork - )} - {project.id === 3 && ( -
-
📊
-
- )} - {project.id === 4 && ( -
-
🤖
-
- )} -
+ {searchQuery && ( +
+

+ Showing {filteredProjects.length} results for{" "} + "{searchQuery}" +

+
+ )} -
-
- - {project.category} - - - {project.level} + {filteredProjects.length > 0 ? ( +
+ {filteredProjects.map((project) => ( + +
+ + {project.tag}
-

- {project.title} -

-
-
-
- - {project.rating} - ({project.reviews} reviews) +
+ {project.id === 1 && Assignment} + {project.id === 2 && Termwork} + {project.id === 3 && ( +
+
📊
+
+ )} + {project.id === 4 && ( +
+
🤖
+
+ )} + {project.id > 4 && ( +
+
📄
+
+ )}
-
-
- - {project.duration} -
+
+
+ {project.category} + {project.level} +
+

{project.title}

+
-
-
- {project.id === 4 ? ( - - FREE - - ) : ( - <> - - ₹{project.price} - - - ₹{project.originalPrice} - - - )} +
+
+ + {project.rating} + ({project.reviews} reviews) +
+
+ +
+ + {project.duration}
- {/* Your new minimal button */} - -
- - ))} -
+ {project.id === 4 ? "Try Now" : "Shop Now"} + + + + + +
+ + ))} +
+ ) : ( +
+
+ + + +
+

No results found for "{searchQuery}"

+

Try different keywords or browse all projects

+ +
+ )}
- {/* Stats Section */}
@@ -337,74 +337,35 @@ const AcademicHub = () => {
- {/* Footer */}
- {/* Company Info */}
A
- - Asshelp - + Asshelp
-

- Your trusted partner for academic excellence. Get premium - assignments and projects delivered on time. -

+

Your trusted partner for academic excellence. Get premium assignments and projects delivered on time.

- {/* Categories */}
-

- Categories -

+

Categories

{categories.map((category) => ( - - {category} - + {category} ))}
- {/* Support */}
@@ -419,4 +380,4 @@ const AcademicHub = () => { ); }; -export default AcademicHub; +export default AcademicHub; \ No newline at end of file diff --git a/src/components/button.tsx b/src/components/button.tsx index 0c94bfc..e146aa0 100644 --- a/src/components/button.tsx +++ b/src/components/button.tsx @@ -1,4 +1,4 @@ -d 'use client'; +'use client'; import React from "react"; import { useRouter } from "next/navigation"; diff --git a/src/components/nav.tsx b/src/components/nav.tsx index 579dfd6..fee7f66 100644 --- a/src/components/nav.tsx +++ b/src/components/nav.tsx @@ -1,112 +1,171 @@ -"use client"; -import { - Navbar, - NavBody, - NavItems, - MobileNav, - NavbarLogo, - NavbarButton, - MobileNavHeader, - MobileNavToggle, - MobileNavMenu, -} from "@/components/ui/resizable-navbar"; -import { useState, useEffect } from "react"; -import { GitHubStarsButton } from '@/components/animate-ui/buttons/github-stars'; -import { useRouter } from "next/navigation"; -import { supabase } from "@/lib/supabaseclient"; -import type { User } from '@supabase/supabase-js'; +'use client'; -export function NavbarDemo() { - const navItems = [ - { - name: "Features", - link: "", - }, - { - name: "AI Generator", - link: "/ai-generator", - }, - { - name: "Contact", - link: "", - }, - ]; +import React, { useState } from 'react'; +import Link from 'next/link'; +import { Search, X } from 'lucide-react'; - const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); - const [user, setUser] = useState(null); - const router = useRouter(); +interface NavbarProps { + searchQuery?: string; + setSearchQuery?: (query: string) => void; +} + +const Navbar = ({ searchQuery = "", setSearchQuery }: NavbarProps) => { + const [isOpen, setIsOpen] = useState(false); + const [showSearch, setShowSearch] = useState(false); - useEffect(() => { - const getUser = async () => { - const { data: { user } } = await supabase.auth.getUser(); - setUser(user); - }; - getUser(); - // Listen for auth state changes - const { data: listener } = supabase.auth.onAuthStateChange((_event, session) => { - setUser(session?.user ?? null); - }); - return () => { - listener?.subscription.unsubscribe(); - }; - }, []); + const clearSearch = () => { + if (setSearchQuery) { + setSearchQuery(""); + } + }; return ( -
- - {/* Desktop Navigation */} - - - -
- - {user === null && ( - router.push('/sign')}>Login - )} -
-
+
+ {/* Mobile Menu */} + {isOpen && ( +
+
+ Home + Services + Portfolio + Contact + Sign in +
+
+ )} + ); -} +}; + +export default Navbar; +export const NavbarDemo = Navbar; \ No newline at end of file diff --git a/src/data/mockProjects.ts b/src/data/mockProjects.ts new file mode 100644 index 0000000..fb62d31 --- /dev/null +++ b/src/data/mockProjects.ts @@ -0,0 +1,95 @@ +// src/data/mockProjects.ts + +export const MOCK_PROJECTS = [ + { + id: 1, + title: "Handwritten Assignment - Population Growth", + category: "Assignments", + level: "Advanced", + price: 100, + rating: 4.9, + reviews: 5, + deliveryTime: "5 days", + tags: ["handwritten", "plagiarism-free", "on-time"], + badge: "Best Seller" + }, + { + id: 2, + title: "Termwork Project with Expert Guidance", + category: "Termwork", + level: "Expert", + price: 250, + rating: 4.8, + reviews: 15, + deliveryTime: "2-3 weeks", + tags: ["expert-guidance", "plagiarism-free"], + badge: "New" + }, + { + id: 3, + title: "Professional PowerPoint Presentation", + category: "Presentations", + level: "Intermediate", + price: 150, + rating: 4.7, + reviews: 8, + deliveryTime: "3-4 days", + tags: ["professional", "custom-design"], + badge: "Popular" + }, + { + id: 4, + title: "Python Programming Assignment", + category: "Assignments", + level: "Advanced", + price: 200, + rating: 4.9, + reviews: 12, + deliveryTime: "1 week", + tags: ["python", "coding", "tested"] + }, + { + id: 5, + title: "Data Science Project with Analysis", + category: "Projects", + level: "Expert", + price: 300, + rating: 5.0, + reviews: 20, + deliveryTime: "2 weeks", + tags: ["data-science", "analysis", "visualization"] + }, + { + id: 6, + title: "Machine Learning Model Development", + category: "Projects", + level: "Expert", + price: 350, + rating: 4.8, + reviews: 10, + deliveryTime: "3 weeks", + tags: ["machine-learning", "AI", "python"] + }, + { + id: 7, + title: "Web Development Project - React", + category: "Projects", + level: "Intermediate", + price: 180, + rating: 4.6, + reviews: 7, + deliveryTime: "1 week", + tags: ["react", "web-dev", "responsive"] + }, + { + id: 8, + title: "Database Design and Implementation", + category: "Assignments", + level: "Advanced", + price: 220, + rating: 4.7, + reviews: 9, + deliveryTime: "5 days", + tags: ["database", "SQL", "design"] + } +]; \ No newline at end of file diff --git a/src/lib/supabaseclient.ts b/src/lib/supabaseclient.ts index 39f02ea..297ed16 100644 --- a/src/lib/supabaseclient.ts +++ b/src/lib/supabaseclient.ts @@ -1,7 +1,17 @@ +// src/lib/supabase.ts (or wherever this file is) + +// TEMPORARILY DISABLED FOR LOCAL DEVELOPMENT +// This allows us to work with mock data without needing Supabase credentials +// TODO: Re-enable when environment variables are properly set up + +/* import { createClient } from '@supabase/supabase-js' -// You can use environment variables for safety const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL as string const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY as string export const supabase = createClient(supabaseUrl, supabaseAnonKey) +*/ + +// Mock export for development - prevents errors when Supabase is imported elsewhere +export const supabase = null; \ No newline at end of file From 9fb275b12f17758994dac061b7d9d29a71b150d8 Mon Sep 17 00:00:00 2001 From: Prachi0306 Date: Sat, 1 Nov 2025 16:31:52 +0530 Subject: [PATCH 2/4] added the search bar to the older navbar --- src/app/dashboard/page.tsx | 5 - src/components/footer.tsx | 80 +++---------- src/components/nav.tsx | 230 ++++++++++++++----------------------- src/lib/supabaseclient.ts | 17 +-- 4 files changed, 99 insertions(+), 233 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 14668bc..d5f5988 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -6,10 +6,7 @@ import { NavbarDemo } from "@/components/nav"; import { AnimatePresence } from "framer-motion"; import AcademicHubSkeleton from "@/components/skeletons/dashboardPageSkeleton"; import { MOCK_PROJECTS } from "@/data/mockProjects"; -import { AnimatePresence } from 'framer-motion'; -import AcademicHubSkeleton from '@/components/skeletons/dashboardPageSkeleton'; import Image from 'next/image'; -import Footer from '@/components/footer'; const MagicCard = ({ children, @@ -377,8 +374,6 @@ const AcademicHub = () => {
- {/* Footer */} -
); diff --git a/src/components/footer.tsx b/src/components/footer.tsx index 562c687..82a3174 100644 --- a/src/components/footer.tsx +++ b/src/components/footer.tsx @@ -12,7 +12,6 @@ export default function Footer() { if (email) { setIsSubscribed(true); setEmail(''); - // Here you would typically send the email to your backend setTimeout(() => setIsSubscribed(false), 3000); } }; @@ -47,31 +46,28 @@ export default function Footer() { return (