Skip to content

Commit 06bc64c

Browse files
authored
Merge branch 'main' into portal-edits
2 parents 00047bb + 1d598ce commit 06bc64c

File tree

14 files changed

+325
-208
lines changed

14 files changed

+325
-208
lines changed

apps/dashboard/src/@/constants/env.ts

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ export const DASHBOARD_THIRDWEB_CLIENT_ID =
44
export const DASHBOARD_THIRDWEB_SECRET_KEY =
55
process.env.DASHBOARD_SECRET_KEY || "";
66

7+
export const NEXT_PUBLIC_NEBULA_APP_CLIENT_ID =
8+
process.env.NEXT_PUBLIC_NEBULA_APP_CLIENT_ID || "";
9+
10+
export const NEBULA_APP_SECRET_KEY = process.env.NEBULA_APP_SECRET_KEY || "";
11+
712
export const THIRDWEB_API_SECRET = process.env.API_SERVER_SECRET || "";
813

914
export const IPFS_GATEWAY_URL =

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/connect/account-abstraction/settings/page.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default async function Page(props: {
6060
trackingCategory="account-abstraction-project-settings"
6161
project={project}
6262
teamId={team.id}
63+
teamSlug={team.slug}
6364
validTeamPlan={getValidTeamPlan(team)}
6465
/>
6566
</ChakraProviderSetup>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/connect/in-app-wallets/settings/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default async function Page(props: {
3030
teamId={team.id}
3131
trackingCategory="in-app-wallet-project-settings"
3232
teamSlug={team_slug}
33-
validTeamPlan={getValidTeamPlan(team)}
33+
teamPlan={getValidTeamPlan(team)}
3434
smsCountryTiers={smsCountryTiers}
3535
/>
3636
);

apps/dashboard/src/app/nebula-app/(app)/components/EmptyStateChatPageContent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ArrowUpRightIcon } from "lucide-react";
55
import type { NebulaContext } from "../api/chat";
66
import { examplePrompts } from "../data/examplePrompts";
77
import { NebulaIcon } from "../icons/NebulaIcon";
8-
import { nebulaThirdwebClient } from "../utils/nebulaThirdwebClient";
8+
import { nebulaAppThirdwebClient } from "../utils/nebulaThirdwebClient";
99
import { ChatBar, type WalletMeta } from "./ChatBar";
1010

1111
export function EmptyStateChatPageContent(props: {
@@ -42,7 +42,7 @@ export function EmptyStateChatPageContent(props: {
4242
setContext={props.setContext}
4343
sendMessage={props.sendMessage}
4444
isChatStreaming={false}
45-
client={nebulaThirdwebClient}
45+
client={nebulaAppThirdwebClient}
4646
connectedWallets={props.connectedWallets}
4747
activeAccountAddress={props.activeAccountAddress}
4848
setActiveWallet={props.setActiveWallet}

apps/dashboard/src/app/nebula-app/(app)/components/NebulaConnectButton.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import { Spinner } from "@/components/ui/Spinner/Spinner";
44
import { Button } from "@/components/ui/button";
5-
import { useThirdwebClient } from "@/constants/thirdweb.client";
65
import { useDashboardRouter } from "@/lib/DashboardRouter";
6+
import { cn } from "@/lib/utils";
77
import { getSDKTheme } from "app/(app)/components/sdk-component-theme";
88
import { useAllChainsData } from "hooks/chains/allChains";
99
import { useTheme } from "next-themes";
@@ -14,15 +14,14 @@ import {
1414
useActiveAccount,
1515
useActiveWalletConnectionStatus,
1616
} from "thirdweb/react";
17-
import { cn } from "../../../../@/lib/utils";
1817
import { doNebulaLogout } from "../../login/auth-actions";
18+
import { nebulaAppThirdwebClient } from "../utils/nebulaThirdwebClient";
1919

2020
export const NebulaConnectWallet = (props: {
2121
connectButtonClassName?: string;
2222
signInLinkButtonClassName?: string;
2323
detailsButtonClassName?: string;
2424
}) => {
25-
const thirdwebClient = useThirdwebClient();
2625
const router = useDashboardRouter();
2726
const { theme } = useTheme();
2827
const t = theme === "light" ? "light" : "dark";
@@ -67,7 +66,7 @@ export const NebulaConnectWallet = (props: {
6766
return (
6867
<ConnectButton
6968
theme={getSDKTheme(t)}
70-
client={thirdwebClient}
69+
client={nebulaAppThirdwebClient}
7170
connectModal={{
7271
privacyPolicyUrl: "/privacy-policy",
7372
termsOfServiceUrl: "/terms",
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1-
import { getThirdwebClient } from "@/constants/thirdweb.server";
1+
import {
2+
IPFS_GATEWAY_URL,
3+
NEBULA_APP_SECRET_KEY,
4+
NEXT_PUBLIC_NEBULA_APP_CLIENT_ID,
5+
} from "@/constants/env";
6+
import {
7+
THIRDWEB_BUNDLER_DOMAIN,
8+
THIRDWEB_INAPP_WALLET_DOMAIN,
9+
THIRDWEB_INSIGHT_API_DOMAIN,
10+
THIRDWEB_PAY_DOMAIN,
11+
THIRDWEB_RPC_DOMAIN,
12+
THIRDWEB_SOCIAL_API_DOMAIN,
13+
THIRDWEB_STORAGE_DOMAIN,
14+
} from "constants/urls";
15+
import { createThirdwebClient } from "thirdweb";
16+
import { setThirdwebDomains } from "thirdweb/utils";
17+
import { getVercelEnv } from "../../../../lib/vercel-utils";
218

3-
export const nebulaThirdwebClient = getThirdwebClient(undefined);
19+
// returns a thirdweb client with optional JWT passed in
20+
function getThirdwebClient() {
21+
if (getVercelEnv() !== "production") {
22+
// if not on production: run this when creating a client to set the domains
23+
setThirdwebDomains({
24+
rpc: THIRDWEB_RPC_DOMAIN,
25+
inAppWallet: THIRDWEB_INAPP_WALLET_DOMAIN,
26+
pay: THIRDWEB_PAY_DOMAIN,
27+
storage: THIRDWEB_STORAGE_DOMAIN,
28+
social: THIRDWEB_SOCIAL_API_DOMAIN,
29+
bundler: THIRDWEB_BUNDLER_DOMAIN,
30+
insight: THIRDWEB_INSIGHT_API_DOMAIN,
31+
});
32+
}
33+
34+
return createThirdwebClient({
35+
secretKey: NEBULA_APP_SECRET_KEY,
36+
clientId: NEXT_PUBLIC_NEBULA_APP_CLIENT_ID,
37+
config: {
38+
storage: {
39+
gatewayUrl: IPFS_GATEWAY_URL,
40+
},
41+
},
42+
});
43+
}
44+
45+
export const nebulaAppThirdwebClient = getThirdwebClient();

apps/dashboard/src/app/nebula-app/login/auth-actions.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
"use server";
22
import "server-only";
33

4-
import {
5-
DASHBOARD_THIRDWEB_SECRET_KEY,
6-
NEXT_PUBLIC_NEBULA_URL,
7-
} from "@/constants/env";
4+
import { NEBULA_APP_SECRET_KEY, NEXT_PUBLIC_NEBULA_URL } from "@/constants/env";
85
import { isVercel } from "lib/vercel-utils";
96
import { cookies } from "next/headers";
107
import { getAddress } from "thirdweb";
@@ -26,7 +23,7 @@ export async function getNebulaLoginPayload(
2623
method: "POST",
2724
headers: {
2825
"Content-Type": "application/json",
29-
"X-Secret-Key": DASHBOARD_THIRDWEB_SECRET_KEY,
26+
"X-Secret-Key": NEBULA_APP_SECRET_KEY,
3027
},
3128
body: JSON.stringify({
3229
address: params.address,
@@ -70,7 +67,7 @@ export async function doNebulaLogin(
7067
method: "POST",
7168
headers: {
7269
"Content-Type": "application/json",
73-
"X-Secret-Key": DASHBOARD_THIRDWEB_SECRET_KEY,
70+
"X-Secret-Key": NEBULA_APP_SECRET_KEY,
7471
},
7572
body: JSON.stringify(payload),
7673
});

apps/dashboard/src/components/embedded-wallets/Configure/InAppWalletSettingsUI.stories.tsx

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type { Team } from "@/api/team";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import { projectStub } from "../../../stories/stubs";
3-
import { mobileViewport } from "../../../stories/utils";
44
import { InAppWalletSettingsUI } from "./index";
55

66
const meta = {
@@ -16,44 +16,44 @@ const meta = {
1616
export default meta;
1717
type Story = StoryObj<typeof meta>;
1818

19-
export const GrowthPlan: Story = {
19+
export const FreePlan: Story = {
2020
args: {
21-
canEditAdvancedFeatures: true,
21+
currentPlan: "free",
2222
},
2323
};
2424

25-
export const FreePlan: Story = {
25+
export const GrowthPlan: Story = {
2626
args: {
27-
canEditAdvancedFeatures: false,
27+
currentPlan: "growth",
2828
},
2929
};
3030

31-
export const GrowthPlanMobile: Story = {
31+
export const AcceleratePlan: Story = {
3232
args: {
33-
canEditAdvancedFeatures: true,
34-
},
35-
parameters: {
36-
viewport: mobileViewport("iphone14"),
33+
currentPlan: "accelerate",
3734
},
3835
};
3936

40-
export const FreePlanMobile: Story = {
37+
export const GrowthLegacyPlan: Story = {
4138
args: {
42-
canEditAdvancedFeatures: false,
39+
currentPlan: "growth_legacy",
4340
},
44-
parameters: {
45-
viewport: mobileViewport("iphone14"),
41+
};
42+
43+
export const ProPlan: Story = {
44+
args: {
45+
currentPlan: "pro",
4646
},
4747
};
4848

4949
function Variants(props: {
50-
canEditAdvancedFeatures: boolean;
50+
currentPlan: Team["billingPlan"];
5151
}) {
5252
return (
5353
<div className="mx-auto w-full max-w-[1140px] px-4 py-6">
5454
<div className="flex flex-col gap-10">
5555
<InAppWalletSettingsUI
56-
canEditAdvancedFeatures={props.canEditAdvancedFeatures}
56+
teamPlan={props.currentPlan}
5757
project={projectStub("foo", "bar")}
5858
teamId="bar"
5959
embeddedWalletService={{

0 commit comments

Comments
 (0)