diff --git a/apps/client/app/(lobby)/event/[id]/page.tsx b/apps/client/app/(lobby)/event/[id]/page.tsx index 40262502..083b03f3 100644 --- a/apps/client/app/(lobby)/event/[id]/page.tsx +++ b/apps/client/app/(lobby)/event/[id]/page.tsx @@ -1,7 +1,7 @@ -"use client" +"use client"; -import OrderBook from '@/components/landing/Orderbook'; -import { useParams } from 'next/navigation' +import OrderBook from "@/components/landing/Orderbook"; +import { useParams } from "next/navigation"; /* TODO: 1. server actiosn to fetch the event from the event id (not sure but for now). @@ -9,15 +9,16 @@ import { useParams } from 'next/navigation' 3. Add event details like name and all. */ export default function Page() { - const {id} = useParams() + const { id } = useParams(); console.log(id); const eventId = Array.isArray(id) ? id[id.length - 1] : id; - if (!eventId) { return
Error: Event ID not found
; } - return
- -
-} \ No newline at end of file + return ( +
+ +
+ ); +} diff --git a/apps/client/app/(lobby)/portfolio/page.tsx b/apps/client/app/(lobby)/portfolio/page.tsx index 09752312..01b8362d 100644 --- a/apps/client/app/(lobby)/portfolio/page.tsx +++ b/apps/client/app/(lobby)/portfolio/page.tsx @@ -6,7 +6,7 @@ import { getTrades } from "@/actions/Trade/getTrades"; import Portfolio from "../../../components/landing/Portfolio"; import { getEventDetails } from "@/actions/Event/getEventDetails"; import axios from "axios"; -import {toast, Toaster} from "react-hot-toast" +import { toast, Toaster } from "react-hot-toast"; export interface Trade { id: string; @@ -18,7 +18,7 @@ export interface Trade { side: "YES" | "NO"; title?: string; gainloss: number | null; - status : "ACTIVE"|"PAST" + status: "ACTIVE" | "PAST"; } export interface Portfolio { id: string; @@ -50,15 +50,13 @@ const Page = () => { }, [userId]); const { status } = useSession(); - const userId = "cm1r277l500178uzhh6kiewxa"; - const getPortfolioDetails = useCallback(async (userId: string) => { setLoading(true); try { const portfolio = await getTrades(userId); console.log("portfolio", portfolio); - + setPortfolioData(portfolio); if (portfolio) { const updatedTrades = await fetchTitles(portfolio.trades); @@ -138,11 +136,11 @@ const Page = () => { price: trade.price, quantity: trade.quantity, type: trade.side, - gainloss : trade.gainloss, - status :trade.status + gainloss: trade.gainloss, + status: trade.status, }))} /> - + ); }; diff --git a/apps/client/components/landing/Orderbook.tsx b/apps/client/components/landing/Orderbook.tsx index e40f888e..8b3d8ad3 100644 --- a/apps/client/components/landing/Orderbook.tsx +++ b/apps/client/components/landing/Orderbook.tsx @@ -17,7 +17,7 @@ import { getEventDetails } from "@/actions/Event/getEventDetails"; import { ArrowUpDown } from "lucide-react"; import { useSession } from "next-auth/react"; -======= + import {toast, Toaster} from "react-hot-toast"