+ View more insights about how users are interacting with your
+ application
+
+
+
+
+
+ {/* Right */}
+
+ {walletsMetrics && (
+
+ )}
+
+
+ );
+};
diff --git a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/_components/header.tsx b/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/_components/header.tsx
deleted file mode 100644
index e3887007cdb..00000000000
--- a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/_components/header.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { TrackedLinkTW } from "@/components/ui/tracked-link";
-import { InAppWalletsSummary } from "components/embedded-wallets/Analytics/Summary";
-import { getInAppWalletUsage } from "data/analytics/wallets/in-app";
-import { TRACKING_CATEGORY } from "../_constants";
-
-export async function InAppWalletsHeader({ clientId }: { clientId: string }) {
- const allTimeStats = await getInAppWalletUsage({
- clientId,
- from: new Date(2022, 0, 1),
- to: new Date(),
- period: "all",
- });
-
- const monthlyStats = await getInAppWalletUsage({
- clientId,
- from: new Date(new Date().getFullYear(), new Date().getMonth(), 1),
- to: new Date(),
- period: "month",
- });
-
- return (
-
-
- In-App Wallets
-
-
- A wallet infrastructure that enables apps to create, manage, and control
- their users wallets. Email login, social login, and bring-your-own auth
- supported.{" "}
-
- Learn more
-
-
- );
-}
diff --git a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/page.tsx b/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/page.tsx
index 811e88fcf48..1b79776584b 100644
--- a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/page.tsx
+++ b/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/page.tsx
@@ -1,4 +1,9 @@
-import { redirect } from "next/navigation";
+import { getProject } from "@/api/projects";
+import { TrackedLinkTW } from "@/components/ui/tracked-link";
+import { notFound } from "next/navigation";
+import { InAppWalletUsersPageContent } from "../../../../../../components/embedded-wallets/Users";
+import { AnalyticsCallout } from "./_components/AnalyticsCallout";
+import { InAppWaletFooterSection } from "./_components/footer";
export default async function Page(props: {
params: {
@@ -6,8 +11,48 @@ export default async function Page(props: {
project_slug: string;
};
}) {
- // Default to the users tab
- redirect(
- `/team/${props.params.team_slug}/${props.params.project_slug}/connect/in-app-wallets/analytics`,
+ const project = await getProject(
+ props.params.team_slug,
+ props.params.project_slug,
+ );
+
+ if (!project) {
+ notFound();
+ }
+
+ const TRACKING_CATEGORY = "team/in-app-wallets";
+
+ return (
+
+
+ In-App Wallets
+
+
+
+ A wallet infrastructure that enables apps to create, manage, and control
+ their users wallets. Email login, social login, and bring-your-own auth
+ supported.{" "}
+
+ Learn more
+
+
+
+
+
+
+
+
+
+
+
);
}
diff --git a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/users/page.tsx b/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/users/page.tsx
deleted file mode 100644
index 8b3683ae657..00000000000
--- a/apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/users/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { InAppWalletUsersPageContent } from "components/embedded-wallets/Users";
-import { TRACKING_CATEGORY } from "../_constants";
-
-export default function Page({
- params,
-}: { params: { team_slug: string; project_slug: string } }) {
- return (
- <>
-
- >
- );
-}
diff --git a/apps/dashboard/src/components/embedded-wallets/Analytics/InAppWalletUsersChartCard.tsx b/apps/dashboard/src/components/embedded-wallets/Analytics/InAppWalletUsersChartCard.tsx
deleted file mode 100644
index 67ec0be8bea..00000000000
--- a/apps/dashboard/src/components/embedded-wallets/Analytics/InAppWalletUsersChartCard.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-"use client";
-import { ExportToCSVButton } from "@/components/blocks/ExportToCSVButton";
-import {
- type ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart";
-import type { InAppWalletStats } from "@3rdweb-sdk/react/hooks/useApi";
-import {
- EmptyChartState,
- LoadingChartState,
-} from "components/analytics/empty-chart-state";
-import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
-import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
-import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
-import { UnrealIcon } from "components/icons/brand-icons/UnrealIcon";
-import { DocLink } from "components/shared/DocLink";
-import { format } from "date-fns";
-import { useMemo } from "react";
-import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
-
-type ChartData = Record & {
- time: string; // human readable date
-};
-
-export function InAppWalletUsersChartCard(props: {
- inAppWalletStats: InAppWalletStats[];
- isPending: boolean;
-}) {
- const { inAppWalletStats } = props;
- const topChainsToShow = 10;
-
- const { chartConfig, chartData } = useMemo(() => {
- const _chartConfig: ChartConfig = {};
- const _chartDataMap: Map = new Map();
- const authMethodToVolumeMap: Map = new Map();
- // for each stat, add it in _chartDataMap
- for (const stat of inAppWalletStats) {
- const chartData = _chartDataMap.get(stat.date);
- const { authenticationMethod } = stat;
-
- // if no data for current day - create new entry
- if (!chartData && stat.uniqueWalletsConnected > 0) {
- _chartDataMap.set(stat.date, {
- time: format(new Date(stat.date), "MMM dd"),
- [authenticationMethod || "Unknown"]: stat.uniqueWalletsConnected,
- } as ChartData);
- } else if (chartData) {
- chartData[authenticationMethod || "Unknown"] =
- (chartData[authenticationMethod || "Unknown"] || 0) +
- stat.uniqueWalletsConnected;
- }
-
- authMethodToVolumeMap.set(
- authenticationMethod || "Unknown",
- stat.uniqueWalletsConnected +
- (authMethodToVolumeMap.get(authenticationMethod || "Unknown") || 0),
- );
- }
-
- const authMethodsSorted = Array.from(authMethodToVolumeMap.entries())
- .sort((a, b) => b[1] - a[1])
- .map((w) => w[0]);
-
- const authMethodsToShow = authMethodsSorted.slice(0, topChainsToShow);
- const authMethodsAsOther = authMethodsSorted.slice(topChainsToShow);
-
- // replace chainIdsToTagAsOther chainId with "other"
- for (const data of _chartDataMap.values()) {
- for (const authMethod in data) {
- if (authMethodsAsOther.includes(authMethod)) {
- data.others = (data.others || 0) + (data[authMethod] || 0);
- delete data[authMethod];
- }
- }
- }
-
- authMethodsToShow.forEach((walletType, i) => {
- _chartConfig[walletType] = {
- label: authMethodsToShow[i],
- color: `hsl(var(--chart-${(i % 10) + 1}))`,
- };
- });
-
- // Add Other
- authMethodsToShow.push("others");
- _chartConfig.others = {
- label: "Others",
- color: "hsl(var(--muted-foreground))",
- };
-
- return {
- chartData: Array.from(_chartDataMap.values()),
- chartConfig: _chartConfig,
- };
- }, [inAppWalletStats]);
-
- const uniqueAuthMethods = Object.keys(chartConfig);
- const disableActions =
- props.isPending ||
- chartData.length === 0 ||
- chartData.every((data) => data.sponsoredUsd === 0);
-
- return (
-
-
- Unique Users
-
-
- The total number of active in-app wallet users on your project.
-
-
-
- {
- // Shows the number of each type of wallet connected on all dates
- const header = ["Date", ...uniqueAuthMethods];
- const rows = chartData.map((data) => {
- const { time, ...rest } = data;
- return [
- time,
- ...uniqueAuthMethods.map((w) => (rest[w] || 0).toString()),
- ];
- });
- return { header, rows };
- }}
- />
-