Skip to content

Commit 581127c

Browse files
committed
Merge branch 'main' into greg/new-ub-components
2 parents f90fcdc + 3f74760 commit 581127c

File tree

200 files changed

+9465
-7655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+9465
-7655
lines changed

.changeset/red-cooks-juggle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix `NFTMetadata` type

apps/dashboard/.storybook/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ const config: StorybookConfig = {
1313
addons: [
1414
getAbsolutePath("@storybook/addon-onboarding"),
1515
getAbsolutePath("@storybook/addon-links"),
16-
getAbsolutePath("@storybook/addon-essentials"),
1716
getAbsolutePath("@chromatic-com/storybook"),
18-
getAbsolutePath("@storybook/addon-interactions"),
17+
getAbsolutePath("@storybook/addon-docs"),
1918
],
2019
framework: {
2120
name: getAbsolutePath("@storybook/nextjs"),

apps/dashboard/.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview } from "@storybook/react";
1+
import type { Preview } from "@storybook/nextjs";
22
import "../src/global.css";
33
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
44
import { MoonIcon, SunIcon } from "lucide-react";

apps/dashboard/knip.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"project": ["src/**"],
1111
"ignoreBinaries": ["only-allow", "biome"],
1212
"ignoreDependencies": [
13-
"@storybook/blocks",
1413
"@thirdweb-dev/service-utils",
1514
"@thirdweb-dev/vault-sdk",
1615
"@types/color",

apps/dashboard/next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ContentSecurityPolicy = `
1212
style-src 'self' 'unsafe-inline' vercel.live;
1313
font-src 'self' vercel.live assets.vercel.com framerusercontent.com fonts.gstatic.com;
1414
frame-src * data:;
15-
script-src 'self' 'unsafe-eval' 'unsafe-inline' 'wasm-unsafe-eval' 'inline-speculation-rules' *.thirdweb.com *.thirdweb-dev.com vercel.live js.stripe.com framerusercontent.com events.framer.com challenges.cloudflare.com;
15+
script-src 'self' 'unsafe-eval' 'unsafe-inline' 'wasm-unsafe-eval' 'inline-speculation-rules' *.thirdweb.com *.thirdweb-dev.com vercel.live js.stripe.com framerusercontent.com events.framer.com challenges.cloudflare.com googletagmanager.com us-assets.i.posthog.com edit.framer.com;
1616
connect-src * data: blob:;
1717
worker-src 'self' blob:;
1818
block-all-mixed-content;

apps/dashboard/package.json

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@
2929
"@emotion/styled": "11.14.0",
3030
"@hookform/resolvers": "^3.9.1",
3131
"@marsidev/react-turnstile": "^1.1.0",
32-
"@radix-ui/react-accordion": "^1.2.7",
33-
"@radix-ui/react-alert-dialog": "^1.1.10",
34-
"@radix-ui/react-avatar": "^1.1.6",
35-
"@radix-ui/react-checkbox": "^1.2.2",
36-
"@radix-ui/react-dialog": "1.1.10",
37-
"@radix-ui/react-dropdown-menu": "^2.1.11",
38-
"@radix-ui/react-hover-card": "^1.1.10",
39-
"@radix-ui/react-label": "^2.1.4",
40-
"@radix-ui/react-popover": "^1.1.10",
41-
"@radix-ui/react-progress": "^1.1.4",
42-
"@radix-ui/react-radio-group": "^1.3.3",
32+
"@radix-ui/react-accordion": "^1.2.11",
33+
"@radix-ui/react-alert-dialog": "^1.1.14",
34+
"@radix-ui/react-avatar": "^1.1.10",
35+
"@radix-ui/react-checkbox": "^1.3.2",
36+
"@radix-ui/react-dialog": "1.1.14",
37+
"@radix-ui/react-dropdown-menu": "^2.1.15",
38+
"@radix-ui/react-hover-card": "^1.1.14",
39+
"@radix-ui/react-label": "^2.1.7",
40+
"@radix-ui/react-popover": "^1.1.14",
41+
"@radix-ui/react-progress": "^1.1.7",
42+
"@radix-ui/react-radio-group": "^1.3.7",
4343
"@radix-ui/react-select": "^2.2.5",
4444
"@radix-ui/react-separator": "^1.1.7",
45-
"@radix-ui/react-slot": "^1.2.0",
46-
"@radix-ui/react-switch": "^1.2.2",
47-
"@radix-ui/react-tooltip": "1.2.3",
45+
"@radix-ui/react-slot": "^1.2.3",
46+
"@radix-ui/react-switch": "^1.2.5",
47+
"@radix-ui/react-tooltip": "1.2.7",
4848
"@scalar/api-reference-react": "^0.6.19",
49-
"@sentry/nextjs": "9.13.0",
50-
"@shazow/whatsabi": "0.21.0",
51-
"@tanstack/react-query": "5.74.4",
49+
"@sentry/nextjs": "9.28.1",
50+
"@shazow/whatsabi": "0.22.2",
51+
"@tanstack/react-query": "5.80.7",
5252
"@tanstack/react-table": "^8.21.3",
5353
"@thirdweb-dev/service-utils": "workspace:*",
5454
"@thirdweb-dev/vault-sdk": "workspace:*",
55-
"@vercel/functions": "2.0.0",
55+
"@vercel/functions": "2.1.0",
5656
"@vercel/og": "^0.6.8",
5757
"abitype": "1.0.8",
5858
"chakra-react-select": "^4.7.6",
@@ -61,16 +61,16 @@
6161
"color": "5.0.0",
6262
"compare-versions": "^6.1.0",
6363
"date-fns": "4.1.0",
64-
"fast-xml-parser": "^5.2.1",
64+
"fast-xml-parser": "^5.2.5",
6565
"fetch-event-stream": "0.1.5",
6666
"flat": "^6.0.1",
67-
"framer-motion": "12.9.2",
67+
"framer-motion": "12.17.0",
6868
"fuse.js": "7.1.0",
6969
"input-otp": "^1.4.1",
7070
"ioredis": "^5.6.1",
7171
"ipaddr.js": "^2.2.0",
72-
"lucide-react": "0.503.0",
73-
"next": "15.3.2",
72+
"lucide-react": "0.514.0",
73+
"next": "15.3.3",
7474
"next-plausible": "^3.12.4",
7575
"next-themes": "^0.4.6",
7676
"nextjs-toploader": "^1.6.12",
@@ -95,55 +95,50 @@
9595
"responsive-rsc": "0.0.7",
9696
"server-only": "^0.0.1",
9797
"shiki": "1.27.0",
98-
"sonner": "2.0.3",
98+
"sonner": "2.0.5",
9999
"spdx-correct": "^3.2.0",
100100
"stripe": "17.7.0",
101-
"swagger-ui-react": "^5.21.0",
101+
"swagger-ui-react": "^5.24.1",
102102
"tailwind-merge": "^2.6.0",
103103
"tailwindcss-animate": "^1.0.7",
104104
"thirdweb": "workspace:*",
105105
"tiny-invariant": "^1.3.3",
106-
"use-debounce": "^10.0.4",
106+
"use-debounce": "^10.0.5",
107107
"vaul": "^1.1.2",
108-
"zod": "3.25.24"
108+
"zod": "3.25.62"
109109
},
110110
"devDependencies": {
111111
"@chakra-ui/cli": "^2.4.1",
112-
"@chromatic-com/storybook": "3.2.6",
113-
"@next/bundle-analyzer": "15.3.2",
114-
"@next/eslint-plugin-next": "15.3.2",
115-
"@playwright/test": "1.52.0",
116-
"@storybook/addon-essentials": "8.6.14",
117-
"@storybook/addon-interactions": "8.6.14",
118-
"@storybook/addon-links": "8.6.14",
119-
"@storybook/addon-onboarding": "8.6.14",
120-
"@storybook/addon-viewport": "8.6.14",
121-
"@storybook/blocks": "8.6.14",
122-
"@storybook/nextjs": "8.6.14",
123-
"@storybook/react": "8.6.14",
124-
"@storybook/test": "8.6.14",
112+
"@chromatic-com/storybook": "4.0.0",
113+
"@next/bundle-analyzer": "15.3.3",
114+
"@next/eslint-plugin-next": "15.3.3",
115+
"@playwright/test": "1.53.0",
116+
"@storybook/addon-docs": "9.0.8",
117+
"@storybook/addon-links": "9.0.8",
118+
"@storybook/addon-onboarding": "9.0.8",
119+
"@storybook/nextjs": "9.0.8",
125120
"@types/color": "4.2.0",
126121
"@types/node": "22.14.1",
127122
"@types/papaparse": "^5.3.16",
128123
"@types/pluralize": "^0.0.33",
129124
"@types/qrcode": "^1.5.5",
130-
"@types/react": "19.1.4",
131-
"@types/react-dom": "19.1.5",
125+
"@types/react": "19.1.8",
126+
"@types/react-dom": "19.1.6",
132127
"@types/react-table": "^7.7.20",
133128
"@types/spdx-correct": "^3.1.3",
134129
"@types/swagger-ui-react": "^5.18.0",
135130
"@typescript-eslint/eslint-plugin": "7.14.1",
136131
"@typescript-eslint/parser": "7.14.1",
137132
"autoprefixer": "^10.4.21",
138-
"checkly": "5.2.0",
133+
"checkly": "5.6.0",
139134
"eslint": "8.57.0",
140135
"eslint-config-biome": "1.9.4",
141-
"eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
142-
"eslint-plugin-storybook": "0.12.0",
143-
"knip": "5.56.0",
136+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
137+
"eslint-plugin-storybook": "9.0.8",
138+
"knip": "5.60.2",
144139
"next-sitemap": "^4.2.3",
145-
"postcss": "8.5.3",
146-
"storybook": "8.6.14",
140+
"postcss": "8.5.5",
141+
"storybook": "9.0.8",
147142
"tailwindcss": "3.4.17",
148143
"typescript": "5.8.3"
149144
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use server";
22
import "server-only";
33

4-
import { randomBytes } from "node:crypto";
4+
// biome-ignore lint/style/useNodejsImportProtocol: breaks storybook if it's `node:` prefixed
5+
import { randomBytes } from "crypto";
56
import type { Team } from "@/api/team";
67
import { format } from "date-fns";
78
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";

apps/dashboard/src/@/api/team-members.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function getMembers(teamSlug: string) {
3333
}
3434

3535
const teamsRes = await fetch(
36-
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamSlug}/members`,
36+
new URL(`/v1/teams/${teamSlug}/members`, NEXT_PUBLIC_THIRDWEB_API_HOST),
3737
{
3838
headers: {
3939
Authorization: `Bearer ${token}`,
@@ -48,15 +48,21 @@ export async function getMembers(teamSlug: string) {
4848
return undefined;
4949
}
5050

51-
export async function getMemberById(teamSlug: string, memberId: string) {
51+
export async function getMemberByAccountId(
52+
teamSlug: string,
53+
accountId: string,
54+
) {
5255
const token = await getAuthToken();
5356

5457
if (!token) {
5558
return undefined;
5659
}
5760

5861
const res = await fetch(
59-
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${teamSlug}/members/${memberId}`,
62+
new URL(
63+
`/v1/teams/${teamSlug}/members/${accountId}`,
64+
NEXT_PUBLIC_THIRDWEB_API_HOST,
65+
),
6066
{
6167
headers: {
6268
Authorization: `Bearer ${token}`,

apps/dashboard/src/@/api/team.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
33
import { API_SERVER_SECRET } from "@/constants/server-envs";
44
import type { TeamResponse } from "@thirdweb-dev/service-utils";
55
import { cookies } from "next/headers";
6+
import { getValidAccount } from "../../app/(app)/account/settings/getAccount";
67
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
78
import { LAST_USED_TEAM_ID } from "../../constants/cookies";
9+
import { getMemberByAccountId } from "./team-members";
810

911
export type Team = TeamResponse & { stripeCustomerId: string | null };
1012

@@ -103,3 +105,23 @@ export async function getLastVisitedTeam() {
103105

104106
return null;
105107
}
108+
109+
export async function hasToCompleteTeamOnboarding(
110+
team: Team,
111+
pagePath: string,
112+
) {
113+
// if the team is already onboarded, we don't need to check anything else here
114+
if (team.isOnboarded) {
115+
return false;
116+
}
117+
const account = await getValidAccount(pagePath);
118+
const teamMember = await getMemberByAccountId(team.slug, account.id);
119+
120+
// if the team member is not an owner (or we cannot find them), they cannot complete onboarding anyways
121+
if (teamMember?.role !== "OWNER") {
122+
return false;
123+
}
124+
125+
// if we get here the team is not onboarded and the team member is an owner, so we need to show the onboarding page
126+
return true;
127+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use client";
2+
import { Suspense } from "react";
3+
import { ClientOnly } from "../../components/ClientOnly/ClientOnly";
4+
import { useIsMobile } from "../hooks/use-mobile";
5+
6+
export function ResponsiveLayout(props: {
7+
desktop: React.ReactNode;
8+
mobile: React.ReactNode;
9+
fallback: React.ReactNode;
10+
debugMode?: boolean;
11+
}) {
12+
const isMobile = useIsMobile();
13+
14+
if (props.debugMode) {
15+
return props.fallback;
16+
}
17+
18+
return (
19+
<Suspense fallback={props.fallback}>
20+
<ClientOnly ssr={props.fallback}>
21+
{isMobile ? props.mobile : props.desktop}
22+
</ClientOnly>
23+
</Suspense>
24+
);
25+
}

0 commit comments

Comments
 (0)