Commit 0e9103b0 by Arjun Jhukal

updated the routes for withdrawl history and deposit history

parent 2b69f936
......@@ -6,10 +6,19 @@ import TabController from "@/components/molecules/TabController";
import { Tab } from "@mui/material";
import WithdrawnHistoryPage from "@/components/pages/dashboard/userDashboard/withdrawlHistory";
import DepositHistoryPage from "@/components/pages/dashboard/userDashboard/depositHistory";
import { useSearchParams } from "next/navigation";
type AccountTabProps = "account" | "deposit" | "withdraw"
export default function ProfilePage() {
const [currentActiveTab, setCurrentActiveTab] = React.useState<AccountTabProps>("account");
const searchParams = useSearchParams();
React.useEffect(() => {
const page = searchParams.get("page");
if (page === "deposit-history") setCurrentActiveTab("deposit");
else if (page === "withdrawl-history") setCurrentActiveTab("withdraw");
else setCurrentActiveTab("account");
}, [searchParams]);
const handleTabChange = (tab: string) => {
setCurrentActiveTab(tab as AccountTabProps);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment