diff --git a/backend/package.json b/backend/package.json index dbc0ed5..6b1787e 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,7 +4,7 @@ "description": "Backend for UniLoot - college-exclusive e-commerce platform", "main": "server.ts", "scripts": { - "dev": "ts-node-dev --respawn --transpile-only src/server.ts", + "dev": "ts-node-dev --respawn --transpile-only src/server.ts", "build": "tsc", "start": "nodemon dist/server.js" }, @@ -29,4 +29,4 @@ "ts-node-dev": "^2.0.0", "typescript": "^5.2.2" } -} \ No newline at end of file +} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d951654..416435e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,6 +9,7 @@ import Browse from "./pages/Browse"; import Sell from "./pages/Sell"; import ProductDetailsPage from "./pages/ProductDetail"; import Navbar from "./components/Navbar"; +import Dashboard from "./pages/Dashboard"; const queryClient = new QueryClient(); const App = () => ( @@ -27,6 +28,7 @@ const App = () => ( } /> } /> } /> + } /> diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx new file mode 100644 index 0000000..ac96368 --- /dev/null +++ b/frontend/src/pages/Dashboard.tsx @@ -0,0 +1,103 @@ +import React from 'react'; +import { Button } from "@/components/ui/button"; +import { ShoppingCart, Tag, Clock } from "lucide-react"; +import { useNavigate } from 'react-router-dom'; + + +const Dashboard: React.FC = () => { + const navigate = useNavigate(); + + // Dummy static data + const boughtItems = [ + { id: 1, name: "Physics Textbook", price: "Rs 30" }, + { id: 2, name: "Laptop Stand", price: "Rs 25" }, + { id: 3, name: "Stationery Kit", price: "Rs 10" }, + ]; + + const soldItems = [ + { id: 1, name: "Old Notes Set", price: "Rs 15" }, + { id: 2, name: "Used Calculator", price: "Rs 20" }, + ]; + + const currentBids = [ + { id: 1, name: "Vintage Laptop", bid: "Rs 50" }, + { id: 2, name: "Art Supplies", bid: "Rs 12" }, + ]; + + +const handleBuyClick = () => { + console.log('Buy button clicked - Navigate to browse page'); + navigate('/browse'); + }; + + const handleSellClick = () => { + console.log('Sell button clicked - Navigate to sell page'); + navigate('/sell'); + }; + + return ( +
+
+

+ Welcome Back, Student! +

+ +
+
+ +

Bought Items

+
+
    + {boughtItems.map(item => ( +
  • + {item.name} + {item.price} +
  • + ))} +
+
+ +
+
+ +

Sold Items

+
+
    + {soldItems.map(item => ( +
  • + {item.name} + {item.price} +
  • + ))} +
+
+ +
+
+ +

Current Bids

+
+
    + {currentBids.map(item => ( +
  • + {item.name} + {item.bid} +
  • + ))} +
+
+ +
+ + +
+
+
+ ); +}; + +export default Dashboard;