Skip to content

Commit ac9b7e2

Browse files
committed
feat(dashboard): team analytics page
1 parent 5de5418 commit ac9b7e2

19 files changed

+561
-101
lines changed

apps/dashboard/src/app/team/[team_slug]/(team)/page.tsx

Lines changed: 507 additions & 45 deletions
Large diffs are not rendered by default.

apps/dashboard/src/app/team/[team_slug]/[project_slug]/page.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import {
2424
import { type WalletId, getWalletInfo } from "thirdweb/wallets";
2525

2626
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
27-
import { CombinedBarChartCard } from "./components/CombinedBarChartCard";
28-
import { EmptyState } from "./components/EmptyState";
29-
import { PieChartCard } from "./components/PieChartCard";
30-
import { ProjectOverviewHeader } from "./components/ProjectOverviewHeader";
31-
import { StatBreakdownCard } from "./components/StatBreakdownCard";
27+
import { AnalyticsHeader } from "../../components/Analytics/AnalyticsHeader";
28+
import { CombinedBarChartCard } from "../../components/Analytics/CombinedBarChartCard";
29+
import { EmptyState } from "../../components/Analytics/EmptyState";
30+
import { PieChartCard } from "../../components/Analytics/PieChartCard";
31+
import { StatBreakdownCard } from "../../components/Analytics/StatBreakdownCard";
3232

3333
type PageParams = {
3434
team_slug: string;
@@ -111,10 +111,10 @@ export default async function ProjectOverviewPage(props: PageProps) {
111111
userOpUsage.length === 0;
112112

113113
return (
114-
<div className="">
114+
<div className="pb-16">
115115
<div className="w-full border-border-800 border-b px-6 dark:bg-muted/50">
116-
<ProjectOverviewHeader
117-
project={project}
116+
<AnalyticsHeader
117+
title={project.name}
118118
interval={interval}
119119
range={range}
120120
/>
@@ -464,6 +464,7 @@ async function getUserOpUsage(args: {
464464
const json = await res.json();
465465

466466
if (res.status !== 200) {
467+
console.log(await res.text());
467468
console.error("Failed to fetch user ops usage");
468469
return [];
469470
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import { getLastNDaysRange } from "components/analytics/date-range-selector";
3-
import { projectStub } from "stories/stubs";
43
import { BadgeContainer, mobileViewport } from "stories/utils";
5-
import { ProjectOverviewHeader } from "./ProjectOverviewHeader";
4+
import { AnalyticsHeader } from "./AnalyticsHeader";
65

76
const meta = {
8-
title: "project/Overview/Header",
7+
title: "Analytics/AnalyticsHeader",
98
component: Component,
109
parameters: {
1110
layout: "centered",
@@ -36,8 +35,8 @@ function Component() {
3635
return (
3736
<div className="container py-8">
3837
<BadgeContainer label="Base">
39-
<ProjectOverviewHeader
40-
project={projectStub("123", "456")}
38+
<AnalyticsHeader
39+
title="Project Overview"
4140
interval="day"
4241
range={getLastNDaysRange("last-120")}
4342
/>
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import type { Project } from "@/api/projects";
21
import type { Range } from "components/analytics/date-range-selector";
32
import { RangeSelector } from "components/analytics/range-selector";
43

5-
export function ProjectOverviewHeader(props: {
6-
project: Project;
4+
export function AnalyticsHeader(props: {
5+
title: string;
76
interval: "day" | "week";
87
range: Range;
98
}) {
10-
const { project, interval, range } = props;
9+
const { title, interval, range } = props;
1110

1211
return (
1312
<div className="container flex flex-col items-start gap-6 px-2 py-6 md:h-[120px] md:flex-row md:items-center md:p-6 md:py-0">
1413
<div className="flex-1">
15-
<h1 className="font-semibold text-3xl text-foreground">
16-
{project.name}
17-
</h1>
14+
<h1 className="font-semibold text-3xl text-foreground">{title}</h1>
1815
</div>
1916
<RangeSelector interval={interval} range={range} />
2017
</div>
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
66
import { UnityIcon } from "components/icons/brand-icons/UnityIcon";
77
import { UnrealIcon } from "components/icons/brand-icons/UnrealIcon";
88
import { DocLink } from "components/shared/DocLink";
9+
import { ArrowRightIcon } from "lucide-react";
910
import Image, { type StaticImageData } from "next/image";
1011
import Link from "next/link";
11-
import accountAbstractionIcon from "../../../../../../public/assets/tw-icons/account-abstraction.svg";
12-
import authIcon from "../../../../../../public/assets/tw-icons/auth.svg";
13-
import payIcon from "../../../../../../public/assets/tw-icons/pay.svg";
14-
import socialAuthIcon from "../../../../../../public/assets/tw-icons/social-auth.svg";
15-
import walletsIcon from "../../../../../../public/assets/tw-icons/wallets.svg";
12+
import accountAbstractionIcon from "../../../../../public/assets/tw-icons/account-abstraction.svg";
13+
import authIcon from "../../../../../public/assets/tw-icons/auth.svg";
14+
import payIcon from "../../../../../public/assets/tw-icons/pay.svg";
15+
import socialAuthIcon from "../../../../../public/assets/tw-icons/social-auth.svg";
16+
import walletsIcon from "../../../../../public/assets/tw-icons/wallets.svg";
1617

1718
export function EmptyState() {
1819
return (
@@ -62,9 +63,9 @@ export function EmptyState() {
6263
</div>
6364
</div>
6465
<div className="flex gap-2">
65-
<Button variant="outline" asChild className="min-w-36">
66+
<Button variant="primary" asChild className="min-w-36">
6667
<Link href="https://portal.thirdweb.com/connect" target="_blank">
67-
View Docs
68+
View Docs <ArrowRightIcon className="ml-2 h-4 w-auto" />
6869
</Link>
6970
</Button>
7071
</div>

0 commit comments

Comments
 (0)