Skip to content

Commit 7058196

Browse files
authored
Merge branch 'main' into yash/skale-custom-gas
2 parents e087405 + 3d6eb96 commit 7058196

File tree

320 files changed

+7070
-6950
lines changed

Some content is hidden

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

320 files changed

+7070
-6950
lines changed

.changeset/fluffy-pets-tie.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 caching issues for headless component; improve code coverage
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Adds `getLastAuthProvider` to get the most recently used auth provider for login

apps/dashboard/framer-rewrites.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module.exports = [
33
// -- home
44
"/",
55
"/pricing",
6+
"/bounties",
7+
"/contact-us",
68
// -- product landing pages --
79
// -- connect
810
"/connect",
@@ -31,4 +33,9 @@ module.exports = [
3133
// -- legal --
3234
"/terms",
3335
"/privacy-policy",
36+
// -- community pages --
37+
"/community/ambassadors",
38+
"/community/startup-program",
39+
// -- grants --
40+
"/grant/superchain",
3441
];

apps/dashboard/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
"@radix-ui/react-slot": "^1.1.0",
4747
"@radix-ui/react-switch": "^1.1.1",
4848
"@radix-ui/react-tooltip": "1.1.4",
49-
"@sentry/nextjs": "8.42.0",
49+
"@sentry/nextjs": "8.43.0",
5050
"@shazow/whatsabi": "^0.17.0",
51-
"@tanstack/react-query": "5.62.3",
51+
"@tanstack/react-query": "5.62.7",
5252
"@tanstack/react-table": "^8.17.3",
5353
"@thirdweb-dev/service-utils": "workspace:*",
5454
"@vercel/functions": "^1.5.1",
@@ -62,13 +62,13 @@
6262
"date-fns": "4.1.0",
6363
"fetch-event-stream": "0.1.5",
6464
"flat": "^6.0.1",
65-
"framer-motion": "11.13.3",
65+
"framer-motion": "11.13.5",
6666
"fuse.js": "7.0.0",
6767
"input-otp": "^1.4.1",
6868
"ioredis": "^5.4.1",
6969
"ipaddr.js": "^2.2.0",
7070
"lucide-react": "0.468.0",
71-
"next": "15.0.4",
71+
"next": "15.1.0",
7272
"next-plausible": "^3.12.4",
7373
"next-seo": "^6.5.0",
7474
"next-themes": "^0.4.4",
@@ -86,10 +86,10 @@
8686
"react-hook-form": "7.53.2",
8787
"react-markdown": "^9.0.1",
8888
"react-table": "^7.8.0",
89-
"recharts": "^2.13.3",
89+
"recharts": "2.14.1",
9090
"remark-gfm": "^4.0.0",
9191
"server-only": "^0.0.1",
92-
"shiki": "1.24.1",
92+
"shiki": "1.24.2",
9393
"sonner": "^1.7.1",
9494
"spdx-correct": "^3.2.0",
9595
"swagger-ui-react": "^5.18.2",
@@ -98,13 +98,13 @@
9898
"thirdweb": "workspace:*",
9999
"tiny-invariant": "^1.3.3",
100100
"use-debounce": "^10.0.4",
101-
"zod": "3.23.8"
101+
"zod": "3.24.1"
102102
},
103103
"devDependencies": {
104104
"@chakra-ui/cli": "^2.4.1",
105105
"@chromatic-com/storybook": "3.2.2",
106-
"@next/bundle-analyzer": "15.0.4",
107-
"@next/eslint-plugin-next": "15.0.4",
106+
"@next/bundle-analyzer": "15.1.0",
107+
"@next/eslint-plugin-next": "15.1.0",
108108
"@playwright/test": "1.49.1",
109109
"@storybook/addon-essentials": "8.4.7",
110110
"@storybook/addon-interactions": "8.4.7",
@@ -116,7 +116,7 @@
116116
"@storybook/react": "8.4.7",
117117
"@storybook/test": "8.4.7",
118118
"@types/color": "4.2.0",
119-
"@types/node": "22.10.1",
119+
"@types/node": "22.10.2",
120120
"@types/papaparse": "^5.3.15",
121121
"@types/pluralize": "^0.0.33",
122122
"@types/qrcode": "^1.5.5",
@@ -128,12 +128,12 @@
128128
"@typescript-eslint/eslint-plugin": "7.14.1",
129129
"@typescript-eslint/parser": "7.14.1",
130130
"autoprefixer": "^10.4.19",
131-
"checkly": "^4.14.0",
131+
"checkly": "^4.15.0",
132132
"eslint": "8.57.0",
133133
"eslint-config-biome": "1.9.4",
134134
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
135135
"eslint-plugin-storybook": "^0.11.1",
136-
"knip": "5.39.2",
136+
"knip": "5.39.4",
137137
"next-sitemap": "^4.2.3",
138138
"postcss": "8.4.49",
139139
"storybook": "8.4.7",

apps/dashboard/redirects.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ async function redirects() {
319319
destination: "/home",
320320
permanent: false,
321321
},
322+
// redirect "/open-source" to "/bounties"
323+
{
324+
source: "/open-source",
325+
destination: "/bounties",
326+
permanent: false,
327+
},
322328
...legacyDashboardToTeamRedirects,
323329
];
324330
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"use server";
2+
3+
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
4+
import { cookies } from "next/headers";
5+
import { getAddress } from "thirdweb";
6+
import { COOKIE_PREFIX_TOKEN } from "../constants/cookie";
7+
import { API_SERVER_URL } from "../constants/env";
8+
9+
/**
10+
* Check that the connected wallet is valid for the current active account
11+
*/
12+
export async function isWalletValidForActiveAccount(params: {
13+
address: string;
14+
account: Account;
15+
authToken: string;
16+
}) {
17+
const cookieStore = await cookies();
18+
const authCookieNameForAddress =
19+
COOKIE_PREFIX_TOKEN + getAddress(params.address);
20+
21+
// authToken for this wallet address should be present
22+
const authTokenForAddress = cookieStore.get(authCookieNameForAddress)?.value;
23+
if (!authTokenForAddress) {
24+
return false;
25+
}
26+
27+
// this authToken should be same as current active authToken
28+
if (authTokenForAddress !== params.authToken) {
29+
return false;
30+
}
31+
32+
// authToken should be valid
33+
const accountRes = await fetch(`${API_SERVER_URL}/v1/account/me`, {
34+
method: "GET",
35+
headers: {
36+
Authorization: `Bearer ${authTokenForAddress}`,
37+
},
38+
});
39+
40+
if (accountRes.status !== 200) {
41+
return false;
42+
}
43+
44+
const account = (await accountRes.json()).data as Account;
45+
46+
// the current account should match the account fetched for the authToken
47+
return account.id === params.account.id;
48+
}

apps/dashboard/src/@/components/blocks/FormFieldSetup.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import { ToolTipLabel } from "@/components/ui/tooltip";
33
import { AsteriskIcon, InfoIcon } from "lucide-react";
44

55
export function FormFieldSetup(props: {
6-
htmlFor: string;
6+
htmlFor?: string;
77
label: string;
88
errorMessage: React.ReactNode | undefined;
99
children: React.ReactNode;
1010
tooltip?: React.ReactNode;
1111
isRequired: boolean;
1212
helperText?: React.ReactNode;
13+
className?: string;
1314
}) {
1415
return (
15-
<div>
16+
<div className={props.className}>
1617
<div className="mb-2 inline-flex items-center gap-1">
1718
<Label htmlFor={props.htmlFor}>{props.label}</Label>
1819

apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"use client";
22

3-
import { Spinner } from "@/components/ui/Spinner/Spinner";
43
import { Button } from "@/components/ui/button";
54
import { useThirdwebClient } from "@/constants/thirdweb.client";
65
import { useStore } from "@/lib/reactive";
7-
import { cn } from "@/lib/utils";
86
import { getSDKTheme } from "app/components/sdk-component-theme";
97
import { CustomChainRenderer } from "components/selects/CustomChainRenderer";
108
import { mapV4ChainToV5Chain } from "contexts/map-chains";
@@ -18,6 +16,7 @@ import type { Chain } from "thirdweb";
1816
import {
1917
ConnectButton,
2018
type NetworkSelectorProps,
19+
useActiveAccount,
2120
useConnectModal,
2221
} from "thirdweb/react";
2322
import { useFavoriteChainIds } from "../../../../app/(dashboard)/(chain)/components/client/star-button";
@@ -29,16 +28,15 @@ import {
2928
addRecentlyUsedChainId,
3029
recentlyUsedChainIdsStore,
3130
} from "../../../../stores/chainStores";
32-
import { useLoggedInUser } from "../../hooks/useLoggedInUser";
3331
import { popularChains } from "../popularChains";
3432

3533
export const CustomConnectWallet = (props: {
3634
loginRequired?: boolean;
3735
connectButtonClassName?: string;
3836
signInLinkButtonClassName?: string;
3937
detailsButtonClassName?: string;
40-
loadingButtonClassName?: string;
4138
chain?: Chain;
39+
isLoggedIn: boolean;
4240
}) => {
4341
const thirdwebClient = useThirdwebClient();
4442
const loginRequired =
@@ -120,25 +118,11 @@ export const CustomConnectWallet = (props: {
120118
]);
121119

122120
// ensures login status on pages that need it
123-
const { isPending, isLoggedIn } = useLoggedInUser();
121+
const { isLoggedIn } = props;
124122
const pathname = usePathname();
123+
const account = useActiveAccount();
125124

126-
if (isPending) {
127-
return (
128-
<>
129-
<div
130-
className={cn(
131-
"flex h-[48px] w-[144px] items-center justify-center rounded-lg border border-border bg-muted",
132-
props.loadingButtonClassName,
133-
)}
134-
>
135-
<Spinner className="size-4" />
136-
</div>
137-
</>
138-
);
139-
}
140-
141-
if (!isLoggedIn && loginRequired) {
125+
if ((!isLoggedIn || !account) && loginRequired) {
142126
return (
143127
<>
144128
<Button

0 commit comments

Comments
 (0)