Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion frontend/src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Suspense } from "react";
import { WalletEntry } from "@/components/wallet/wallet-entry";

export default function AppDashboardPage() {
return <WalletEntry />;
return (
<Suspense>
<WalletEntry />
</Suspense>
);
}
14 changes: 12 additions & 2 deletions frontend/src/components/dashboard/dashboard-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from "react";
import Link from "next/link";
import { useSearchParams, useRouter } from "next/navigation";
import toast from "react-hot-toast";

/**
Expand Down Expand Up @@ -513,9 +514,14 @@ const RecentActivityList = React.memo(function RecentActivityList({

// ─── Main Component ───────────────────────────────────────────────────────────

const VALID_TAB_IDS = new Set(SIDEBAR_ITEMS.map((item) => item.id));

export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
const queryClient = useQueryClient();
const [activeTab, setActiveTab] = React.useState("overview");
const router = useRouter();
const searchParams = useSearchParams();
const tabParam = searchParams.get("tab");
const activeTab = VALID_TAB_IDS.has(tabParam ?? "") ? (tabParam as string) : "overview";
const [showWizard, setShowWizard] = React.useState(false);
const [modal, setModal] = React.useState<ModalState>(null);

Expand Down Expand Up @@ -1398,7 +1404,11 @@ export function DashboardView({ session, onDisconnect }: DashboardViewProps) {
className="sidebar-item"
data-active={activeTab === item.id ? "true" : undefined}
aria-current={activeTab === item.id ? "page" : undefined}
onClick={() => setActiveTab(item.id)}
onClick={() => {
const params = new URLSearchParams(searchParams.toString());
params.set("tab", item.id);
router.replace(`?${params.toString()}`);
}}
>
{item.label}
</button>
Expand Down
Loading