diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bedebf..5f0d3ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: CI on: workflow_dispatch: push: + pull_request: permissions: contents: read diff --git a/.github/workflows/deno-deploy.yml b/.github/workflows/deno-deploy.yml index 8f49850..f32ed4a 100644 --- a/.github/workflows/deno-deploy.yml +++ b/.github/workflows/deno-deploy.yml @@ -2,7 +2,6 @@ name: Deno Deploy on: push: - pull_request: workflow_dispatch: jobs: diff --git a/src/components/dashboard-page.tsx b/src/components/dashboard-page.tsx index 6fc7e4d..7938a58 100644 --- a/src/components/dashboard-page.tsx +++ b/src/components/dashboard-page.tsx @@ -1,10 +1,30 @@ +import { lazy, Suspense } from "react"; import { useAppKitAccount, useAppKitNetwork } from "@reown/appkit/react"; import { ICONS } from "./iconography.tsx"; import { PoolDisplay } from "./pool-display.tsx"; -import { ConnectWalletButton } from "./connect-wallet.tsx"; import { supportedChains } from "../wallet/config.ts"; import { useStatusMessageState } from "../context/status-message.tsx"; +/** + * Lazy-loaded wallet connector button component. + * Dynamically imported to reduce initial bundle size. + * Falls back to skeleton while loading. + */ +const ConnectWalletButton = lazy(() => import("./connect-wallet.tsx").then(mod => ({ default: mod.ConnectWalletButton }))); + +/** + * Loading skeleton placeholder for the wallet button. + * Displayed while the wallet connector is being lazy-loaded. + * @returns {JSX.Element} Skeleton div with placeholder styling + */ +const WalletButtonSkeleton = () => ( +
+); + +/** + * Logo span component displaying the DAO logo. + * @returns {JSX.Element} Span containing the DAO logo icon + */ const LogoSpan = () => {ICONS.DAO_LOGO}; export function DashboardPage() { @@ -26,7 +46,9 @@ export function DashboardPage() { -