From 8bb4d4bc1175bbc6ef23fdc19ec8e483b750c1e7 Mon Sep 17 00:00:00 2001 From: MananTank Date: Tue, 24 Jun 2025 22:27:52 +0000 Subject: [PATCH] Dashboard: remove date selector from UB FTUX, improved skeletons (#7435) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on refactoring the `Page` component in the `loading.tsx` file and the `PayAnalytics` component in the `PayAnalytics.tsx` file, enhancing the structure and user experience by modifying the rendering of analytics and loading states. ### Detailed summary - Removed `ResponsiveSuspense` and `PayAnalyticsFilter` from `loading.tsx`. - Integrated `PayAnalytics` directly into the `Page` component. - Added `ResponsiveSuspense` with a skeleton loader in `PayAnalytics`. - Reorganized analytics display in `PayAnalytics`, including filtering and layout adjustments. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - **Refactor** - Improved the loading experience in the PayAnalytics section with responsive skeleton placeholders during data loading. - Updated the layout to display analytics filters above the loading state for better usability. - **Chores** - Removed unused loading and suspense logic from related pages to streamline the user interface. --- .../components/PayAnalytics.tsx | 99 ++++++++++++------- .../(sidebar)/universal-bridge/loading.tsx | 3 - .../(sidebar)/universal-bridge/page.tsx | 35 ++----- 3 files changed, 73 insertions(+), 64 deletions(-) delete mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/loading.tsx diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/components/PayAnalytics.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/components/PayAnalytics.tsx index 84ce0ee17a6..8c2696a5c86 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/components/PayAnalytics.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/components/PayAnalytics.tsx @@ -1,3 +1,4 @@ +import { ResponsiveSuspense } from "responsive-rsc"; import type { ThirdwebClient } from "thirdweb"; import { getUniversalBridgeUsage, @@ -5,7 +6,9 @@ import { } from "@/api/analytics"; import type { Range } from "@/components/analytics/date-range-selector"; import { CodeServer } from "@/components/ui/code/code.server"; +import { Skeleton } from "@/components/ui/skeleton"; import { apiCode, embedCode, sdkCode } from "./code-examples"; +import { PayAnalyticsFilter } from "./PayAnalyticsFilter"; import { PayCustomersTable } from "./PayCustomersTable"; import { PayEmbedFTUX } from "./PayEmbedFTUX"; import { PaymentHistory } from "./PaymentHistory"; @@ -96,44 +99,70 @@ export async function PayAnalytics(props: { } return ( -
- -
- x.status === "completed") || []} - /> -
- x.status === "completed") || []} - dateFormat={dateFormat} - /> -
- -
- - x.status === "completed") || []} - dateFormat={dateFormat} - /> - - - - +
+
+
+ + +
+ + +
+
+ + +
+ +
+ } + searchParamsUsed={["from", "to", "interval"]} + > +
+ +
+ x.status === "completed") || []} + /> +
+ x.status === "completed") || []} + dateFormat={dateFormat} + /> +
- -
- +
+ + x.status === "completed") || []} + dateFormat={dateFormat} + /> + + + + +
+ + +
+ +
+ +
+ + +
- -
- - - +
); } diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/loading.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/loading.tsx deleted file mode 100644 index 6c54ef15def..00000000000 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/loading.tsx +++ /dev/null @@ -1,3 +0,0 @@ -"use client"; - -export { GenericLoadingPage as default } from "@/components/blocks/skeletons/GenericLoadingPage"; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/page.tsx index 61e28bd6da2..c725d9360ce 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/universal-bridge/page.tsx @@ -1,16 +1,11 @@ import { loginRedirect } from "@app/login/loginRedirect"; import { ArrowUpRightIcon } from "lucide-react"; import { redirect } from "next/navigation"; -import { - ResponsiveSearchParamsProvider, - ResponsiveSuspense, -} from "responsive-rsc"; +import { ResponsiveSearchParamsProvider } from "responsive-rsc"; import { getAuthToken } from "@/api/auth-token"; import { getProject } from "@/api/projects"; -import { Spinner } from "@/components/ui/Spinner/Spinner"; import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; import { PayAnalytics } from "./components/PayAnalytics"; -import { PayAnalyticsFilter } from "./components/PayAnalyticsFilter"; import { getUniversalBridgeFiltersFromSearchParams } from "./components/time"; export default async function Page(props: { @@ -54,26 +49,14 @@ export default async function Page(props: { return (
-
- -
- - -
- } - searchParamsUsed={["from", "to", "interval"]} - > - - +