Skip to content

Commit 62de6dd

Browse files
committed
[TOOL-3684] Dashboard: Add FTUX in project overview page (#6466)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces several enhancements and fixes across various components in the dashboard application, including new features, property adjustments, and structural changes for improved functionality and usability. ### Detailed summary - Added `showRangeSelector` property to `AnalyticsHeader`. - Updated `RotateSecretKeyButton` to be exported. - Removed `isEnabled` property and replaced it with `isDisabled` across multiple components. - Introduced `IntegrateAPIKeyCodeTabs` and related sections in `ProjectFTUX`. - Enhanced project integration sections with new UI components and improved code examples. - Refactored `NotificationButtonInner` and other components to remove `isEnabled` checks. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 6fc6c6e commit 62de6dd

File tree

22 files changed

+649
-29
lines changed

22 files changed

+649
-29
lines changed

apps/dashboard/.storybook/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ const config: StorybookConfig = {
2727
},
2828
},
2929
staticDirs: ["../public"],
30+
features: {
31+
experimentalRSC: true,
32+
},
3033
};
3134
export default config;

apps/dashboard/src/@/components/blocks/code-segment.client.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({
9696
onClick: () => setEnvironment(env.environment),
9797
isActive: activeEnvironment === env.environment,
9898
name: env.title,
99-
isEnabled: true,
10099
}))}
101100
tabClassName="text-sm gap-2 !text-sm"
102101
tabIconClassName="size-4"

apps/dashboard/src/@/components/ui/DatePickerWithRange.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ export function DatePickerWithRange(props: {
9191
name: "From",
9292
onClick: () => setScreen("from"),
9393
isActive: screen === "from",
94-
isEnabled: true,
9594
},
9695
{
9796
name: "To",
9897
onClick: () => setScreen("to"),
9998
isActive: screen === "to",
100-
isEnabled: true,
10199
},
102100
]}
103101
/>

apps/dashboard/src/@/components/ui/tabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function TabButtons(props: {
7979
name: React.ReactNode;
8080
onClick: () => void;
8181
isActive: boolean;
82-
isEnabled?: boolean;
82+
isDisabled?: boolean;
8383
icon?: React.FC<{ className?: string }>;
8484
}[];
8585
tabClassName?: string;
@@ -119,11 +119,11 @@ export function TabButtons(props: {
119119
"relative inline-flex h-auto items-center gap-1.5 rounded-lg px-2 font-medium text-sm hover:bg-accent lg:px-3 lg:text-base",
120120
!tab.isActive &&
121121
"text-muted-foreground hover:text-foreground",
122-
!tab.isEnabled && "cursor-not-allowed opacity-50",
122+
tab.isDisabled && "cursor-not-allowed opacity-50",
123123
props.tabClassName,
124124
tab.isActive && props.activeTabClassName,
125125
)}
126-
onClick={tab.isEnabled ? tab.onClick : undefined}
126+
onClick={!tab.isDisabled ? tab.onClick : undefined}
127127
>
128128
{tab.icon && (
129129
<tab.icon className={cn("size-6", props.tabIconClassName)} />

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-button.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
7171
name: mode,
7272
isActive: mode === listingMode,
7373
onClick: () => setListingMode(mode),
74-
isEnabled: true,
7574
}))}
7675
tabClassName="text-sm gap-2 !text-sm"
7776
tabContainerClassName="gap-0.5"

apps/dashboard/src/app/account/contracts/_components/GetStartedWithContractsDeploy.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ const DeployOptions = (props: {
100100
key,
101101
name: value.title,
102102
isActive: activeTab === key,
103-
isEnabled: true,
104103
onClick: () => setActiveTab(key as TabId),
105104
}))}
106105
tabClassName="font-medium"

apps/dashboard/src/app/login/onboarding/LoginOrSignup/LoginOrSignup.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ export function LoginOrSignup(props: {
8989
name: "Create account",
9090
onClick: () => setTab("signup"),
9191
isActive: tab === "signup",
92-
isEnabled: true,
9392
},
9493
{
9594
name: "I already have an account",
9695
onClick: () => setTab("login"),
9796
isActive: tab === "login",
98-
isEnabled: true,
9997
},
10098
]}
10199
/>

apps/dashboard/src/app/login/onboarding/team-onboarding/InviteTeamMembers.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,11 @@ function InviteModalContent(props: {
227227
name: "Starter",
228228
onClick: () => setPlanToShow("starter"),
229229
isActive: planToShow === "starter",
230-
isEnabled: true,
231230
},
232231
{
233232
name: "Growth",
234233
onClick: () => setPlanToShow("growth"),
235234
isActive: planToShow === "growth",
236-
isEnabled: true,
237235
},
238236
]}
239237
/>

apps/dashboard/src/app/login/onboarding/team-onboarding/team-onboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use client";
22

33
import { getBillingCheckoutUrl } from "@/actions/billing";
4+
import { apiServerProxy } from "@/actions/proxies";
45
import { sendTeamInvites } from "@/actions/sendTeamInvite";
56
import type { Team } from "@/api/team";
67
import { useDashboardRouter } from "@/lib/DashboardRouter";
78
import { toast } from "sonner";
89
import type { ThirdwebClient } from "thirdweb";
910
import { upload } from "thirdweb/storage";
10-
import { apiServerProxy } from "../../../../@/actions/proxies";
1111
import { useTrack } from "../../../../hooks/analytics/useTrack";
1212
import { updateTeam } from "../../../team/[team_slug]/(team)/~/settings/general/updateTeam";
1313
import { InviteTeamMembersUI } from "./InviteTeamMembers";

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ export default async function TeamOverviewPage(props: {
6363
return (
6464
<div className="flex grow flex-col">
6565
<div className="border-b">
66-
<AnalyticsHeader title="Analytics" interval={interval} range={range} />
66+
<AnalyticsHeader
67+
title="Analytics"
68+
interval={interval}
69+
range={range}
70+
showRangeSelector={true}
71+
/>
6772
</div>
6873
<div className="flex grow flex-col justify-between gap-10 md:container md:pt-8 md:pb-16">
6974
<Suspense fallback={<GenericLoadingPage />}>

apps/dashboard/src/app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/configuration/components/engine-wallet-config.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export const EngineWalletConfig: React.FC<EngineWalletConfigProps> = ({
8686
key,
8787
name,
8888
isActive: activeTab === key,
89-
isEnabled: true,
9089
onClick: () => setActiveTab(key),
9190
icon:
9291
(key === "aws-kms" && !isAwsKmsConfigured) ||

apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/members/TeamMembersSettingsPage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ export function TeamMembersSettingsPage(props: {
6262
isActive: manageTab === "members",
6363
name: "Team Members",
6464
onClick: () => setManageTab("members"),
65-
isEnabled: true,
6665
},
6766
{
6867
isActive: manageTab === "invites",
6968
name: "Pending Invites",
7069
onClick: () => setManageTab("invites"),
71-
isEnabled: true,
7270
},
7371
]}
7472
/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"use client";
2+
3+
import { TabButtons } from "@/components/ui/tabs";
4+
import { useState } from "react";
5+
6+
type TabKey = "ts" | "react" | "react-native" | "dotnet" | "unity" | "unreal";
7+
8+
const tabNames: Record<TabKey, string> = {
9+
ts: "TypeScript",
10+
react: "React",
11+
"react-native": "React Native",
12+
dotnet: ".NET",
13+
unity: "Unity",
14+
unreal: "Unreal Engine",
15+
};
16+
17+
export function IntegrateAPIKeyCodeTabs(props: {
18+
tabs: Record<TabKey, React.ReactNode>;
19+
}) {
20+
const [tab, setTab] = useState<TabKey>("ts");
21+
22+
return (
23+
<div>
24+
<TabButtons
25+
tabClassName="!text-sm"
26+
tabs={Object.entries(tabNames).map(([key, name]) => ({
27+
name,
28+
onClick: () => setTab(key as TabKey),
29+
isActive: tab === key,
30+
}))}
31+
/>
32+
<div className="h-3" />
33+
{props.tabs[tab]}
34+
</div>
35+
);
36+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import { projectStub } from "../../../../../../stories/stubs";
3+
import { ProjectFTUX } from "./ProjectFTUX";
4+
5+
const meta = {
6+
title: "Project/ProjectFTUX",
7+
component: ProjectFTUX,
8+
decorators: [
9+
(Story) => (
10+
<div className="container py-8 pb-20">
11+
<Story />
12+
</div>
13+
),
14+
],
15+
} satisfies Meta<typeof ProjectFTUX>;
16+
17+
export default meta;
18+
type Story = StoryObj<typeof meta>;
19+
20+
export const Default: Story = {
21+
args: {
22+
project: {
23+
...projectStub("foo", "bar"),
24+
secretKeys: [
25+
{
26+
createdAt: new Date().toISOString(),
27+
updatedAt: new Date().toISOString(),
28+
hash: "1234567890",
29+
masked: "1234567890",
30+
},
31+
],
32+
},
33+
teamSlug: "bar",
34+
},
35+
};

0 commit comments

Comments
 (0)