Skip to content

Commit 03d5676

Browse files
authored
Merge branch 'main' into 11-26-update_metadata_for_explore_page
2 parents 530e978 + b9f85f8 commit 03d5676

File tree

24 files changed

+640
-860
lines changed

24 files changed

+640
-860
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

apps/dashboard/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
"@radix-ui/react-tooltip": "1.1.4",
4949
"@sentry/nextjs": "8.40.0",
5050
"@shazow/whatsabi": "^0.17.0",
51-
"@tanstack/react-query": "5.61.3",
51+
"@tanstack/react-query": "5.61.4",
5252
"@tanstack/react-table": "^8.17.3",
5353
"@thirdweb-dev/service-utils": "workspace:*",
5454
"@vercel/functions": "^1.4.2",
5555
"@vercel/og": "^0.6.4",
5656
"abitype": "1.0.6",
5757
"chakra-react-select": "^4.7.6",
58-
"class-variance-authority": "^0.7.0",
58+
"class-variance-authority": "^0.7.1",
5959
"clsx": "^2.1.1",
6060
"color": "^4.2.3",
6161
"compare-versions": "^6.1.0",
@@ -66,7 +66,6 @@
6666
"input-otp": "^1.4.1",
6767
"ioredis": "^5.4.1",
6868
"ipaddr.js": "^2.2.0",
69-
"lottie-react": "^2.4.0",
7069
"lucide-react": "0.461.0",
7170
"next": "15.0.3",
7271
"next-plausible": "^3.12.4",
@@ -117,7 +116,7 @@
117116
"@storybook/react": "8.4.5",
118117
"@storybook/test": "8.4.5",
119118
"@types/color": "4.2.0",
120-
"@types/node": "20.14.9",
119+
"@types/node": "22.10.0",
121120
"@types/papaparse": "^5.3.15",
122121
"@types/pluralize": "^0.0.33",
123122
"@types/qrcode": "^1.5.5",
@@ -134,7 +133,7 @@
134133
"eslint-config-biome": "1.9.3",
135134
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
136135
"eslint-plugin-storybook": "^0.11.1",
137-
"knip": "5.37.2",
136+
"knip": "5.38.0",
138137
"next-sitemap": "^4.2.3",
139138
"postcss": "8.4.49",
140139
"storybook": "8.4.5",

apps/dashboard/public/assets/product-pages/connect/connect-lottie.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/dashboard/public/assets/product-pages/engine/lottie.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/dashboard/public/assets/product-pages/engine/lottie2.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/dashboard/src/@/actions/billing.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"use server";
22

33
import "server-only";
4-
import { API_SERVER_URL, getAbsoluteUrlFromPath } from "@/constants/env";
4+
import { API_SERVER_URL } from "@/constants/env";
55
import { redirect } from "next/navigation";
66
import { getAuthToken } from "../../app/api/lib/getAuthToken";
77
import type { ProductSKU } from "../lib/billing";
88

99
export type RedirectCheckoutOptions = {
1010
teamSlug: string;
1111
sku: ProductSKU;
12-
redirectPath?: string;
12+
redirectUrl: string;
1313
metadata?: Record<string, string>;
1414
};
1515
export async function redirectToCheckout(
@@ -34,10 +34,7 @@ export async function redirectToCheckout(
3434
method: "POST",
3535
body: JSON.stringify({
3636
sku: options.sku,
37-
redirectTo: getAbsoluteUrlFromPath(
38-
options.redirectPath ||
39-
`/team/${options.teamSlug}/~/settings/billing`,
40-
).toString(),
37+
redirectTo: options.redirectUrl,
4138
metadata: options.metadata || {},
4239
}),
4340
headers: {
@@ -64,7 +61,7 @@ export async function redirectToCheckout(
6461

6562
export type BillingPortalOptions = {
6663
teamSlug: string | undefined;
67-
redirectPath?: string;
64+
redirectUrl: string;
6865
};
6966
export async function redirectToBillingPortal(
7067
options: BillingPortalOptions,
@@ -86,10 +83,7 @@ export async function redirectToBillingPortal(
8683
{
8784
method: "POST",
8885
body: JSON.stringify({
89-
redirectTo: getAbsoluteUrlFromPath(
90-
options.redirectPath ||
91-
`/team/${options.teamSlug}/~/settings/billing`,
92-
).toString(),
86+
redirectTo: options.redirectUrl,
9387
}),
9488
headers: {
9589
"Content-Type": "application/json",

apps/dashboard/src/@/components/billing.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import {
88
} from "../actions/billing";
99
import { Button, type ButtonProps } from "./ui/button";
1010

11-
type CheckoutButtonProps = RedirectCheckoutOptions & ButtonProps;
11+
type CheckoutButtonProps = Omit<RedirectCheckoutOptions, "redirectUrl"> &
12+
ButtonProps & {
13+
redirectPath: string;
14+
};
15+
1216
export function CheckoutButton({
1317
onClick,
1418
teamSlug,
@@ -27,7 +31,7 @@ export function CheckoutButton({
2731
teamSlug,
2832
sku,
2933
metadata,
30-
redirectPath,
34+
redirectUrl: getRedirectUrl(redirectPath),
3135
});
3236
}}
3337
>
@@ -36,7 +40,10 @@ export function CheckoutButton({
3640
);
3741
}
3842

39-
type BillingPortalButtonProps = BillingPortalOptions & ButtonProps;
43+
type BillingPortalButtonProps = Omit<BillingPortalOptions, "redirectUrl"> &
44+
ButtonProps & {
45+
redirectPath: string;
46+
};
4047
export function BillingPortalButton({
4148
onClick,
4249
teamSlug,
@@ -51,11 +58,17 @@ export function BillingPortalButton({
5158
onClick?.(e);
5259
await redirectToBillingPortal({
5360
teamSlug,
54-
redirectPath,
61+
redirectUrl: getRedirectUrl(redirectPath),
5562
});
5663
}}
5764
>
5865
{children}
5966
</Button>
6067
);
6168
}
69+
70+
function getRedirectUrl(path: string) {
71+
const url = new URL(window.location.origin);
72+
url.pathname = path;
73+
return url.toString();
74+
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,3 @@ export const BASE_URL = isProd
3939
: (process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL
4040
? `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}`
4141
: "http://localhost:3000") || "https://thirdweb-dev.com";
42-
43-
export function getAbsoluteUrlFromPath(path: string) {
44-
const url = new URL(BASE_URL);
45-
46-
url.pathname = path;
47-
return url;
48-
}

apps/dashboard/src/app/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/overview/components/backend-wallets-table.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ const ReceiveFundsModal = ({
371371
address={backendWallet.address}
372372
shortenAddress={false}
373373
/>
374+
{/* eslint-disable-next-line @next/next/no-img-element */}
374375
<img
375376
src={qrCodeBase64Query.data}
376377
alt="QR code for receiving funds"

apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export function PlanInfoCard(props: {
4949

5050
<div className="flex flex-row gap-2">
5151
{/* manage team billing */}
52-
<BillingPortalButton teamSlug={team.slug} variant="outline">
52+
<BillingPortalButton
53+
teamSlug={team.slug}
54+
variant="outline"
55+
redirectPath={`/team/${team.slug}/~/settings/billing`}
56+
>
5357
Manage Billing
5458
</BillingPortalButton>
5559

0 commit comments

Comments
 (0)