Skip to content

Commit 8e22cf8

Browse files
committed
[Ecosystem Portal] Fix: WalletConnect Connection (#5438)
CNCT-2258 <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the `wallet-ui` application, introducing multi-tenancy support, updating configurations, and improving code quality with better imports and utility functions. ### Detailed summary - Removed unused files: `erc20.ts`, `Erc20Token.ts` - Added `isMultiTenant` utility for environment checks - Updated `README.md` for ecosystem portal - Enhanced routing with ecosystem ID in redirects - Introduced new configuration files for `knip` and `biome` - Updated ESLint rules and configurations - Refactored image handling to use a new `Image` component - Streamlined various imports across components and hooks > The following files were skipped due to too many changes: `pnpm-lock.yaml` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 565dbb9 commit 8e22cf8

File tree

32 files changed

+400
-327
lines changed

32 files changed

+400
-327
lines changed

.github/labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ playground:
88
packages:
99
- changed-files:
1010
- any-glob-to-any-file: "packages/**/*"
11+
sdk:
12+
- changed-files:
13+
- any-glob-to-any-file: "packages/thirdweb/**/*"
1114
portal:
1215
- changed-files:
1316
- any-glob-to-any-file: "apps/portal/**/*"
17+
"Ecosystem Portal":
18+
- changed-files:
19+
- any-glob-to-any-file: "apps/wallet-ui/**/*"

apps/wallet-ui/.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Root domain for the app
2-
NEXT_PUBLIC_ROOT_DOMAIN=ecosystem.localhost:3000
2+
NEXT_PUBLIC_ROOT_DOMAIN=localhost:3000
3+
# If set to production, multi-tenant subdomains will be used
4+
NEXT_PUBLIC_ENVIRONMENT=development
35
# Thirdweb client ID
46
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=
57
# Thirdweb API key

apps/wallet-ui/.eslintrc.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:@next/next/recommended",
6+
],
7+
rules: {
8+
"react-compiler/react-compiler": "error",
9+
"no-restricted-syntax": [
10+
"error",
11+
{
12+
selector: "CallExpression[callee.name='useEffect']",
13+
message:
14+
'Are you *sure* you need to use "useEffect" here? If you loading any async function prefer using "useQuery".',
15+
},
16+
{
17+
selector: "CallExpression[callee.name='createContext']",
18+
message:
19+
'Are you *sure* you need to use a "Context"? In almost all cases you should prefer passing props directly.',
20+
},
21+
],
22+
"no-restricted-imports": [
23+
"error",
24+
{
25+
paths: [
26+
{
27+
name: "next/navigation",
28+
importNames: ["useRouter"],
29+
message:
30+
'Use `import { useRouter } from "@/lib/useRouter";` instead',
31+
},
32+
],
33+
},
34+
],
35+
},
36+
parser: "@typescript-eslint/parser",
37+
plugins: ["@typescript-eslint", "react-compiler"],
38+
parserOptions: {
39+
ecmaVersion: 2019,
40+
ecmaFeatures: {
41+
impliedStrict: true,
42+
jsx: true,
43+
},
44+
warnOnUnsupportedTypeScriptVersion: true,
45+
},
46+
settings: {
47+
react: {
48+
createClass: "createReactClass",
49+
pragma: "React",
50+
version: "detect",
51+
},
52+
},
53+
overrides: [
54+
// enable rule specifically for TypeScript files
55+
{
56+
files: ["*.ts", "*.tsx"],
57+
rules: {
58+
"@typescript-eslint/explicit-module-boundary-types": ["off"],
59+
},
60+
},
61+
// THIS NEEDS TO GO LAST!
62+
{
63+
files: ["*.ts", "*.js", "*.tsx", "*.jsx"],
64+
extends: ["biome"],
65+
},
66+
],
67+
env: {
68+
browser: true,
69+
node: true,
70+
},
71+
};

apps/wallet-ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# thirdweb Wallet UI
1+
# thirdweb Ecosystem Portal

apps/wallet-ui/biome.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
3+
"extends": ["../../biome.json"],
4+
"overrides": [
5+
{
6+
"include": ["src/css/swagger-ui.css"],
7+
"linter": {
8+
"rules": {
9+
"suspicious": {
10+
"noImportantInKeyframe": "off"
11+
}
12+
}
13+
}
14+
}
15+
]
16+
}

apps/wallet-ui/knip.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@latest/schema.json",
3+
"next": true,
4+
"ignore": ["src/components/ui/**"],
5+
"ignoreBinaries": ["biome"],
6+
"ignoreDependencies": ["thirdweb"],
7+
"project": ["src/**"]
8+
}

apps/wallet-ui/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "biome check ./src",
10-
"fix": "biome check ./src --fix"
9+
"lint": "biome check ./src && knip && eslint ./src",
10+
"fix": "biome check ./src --fix && knip --fix --allow-remove-files && eslint ./src --fix"
1111
},
1212
"dependencies": {
1313
"@hookform/resolvers": "^3.9.1",
@@ -16,7 +16,6 @@
1616
"@radix-ui/react-label": "^2.1.0",
1717
"@radix-ui/react-popover": "^1.1.2",
1818
"@radix-ui/react-slot": "^1.1.0",
19-
"@radix-ui/react-toast": "^1.2.2",
2019
"@tanstack/react-query": "5.60.2",
2120
"class-variance-authority": "^0.7.0",
2221
"clsx": "^2.1.1",
@@ -27,6 +26,7 @@
2726
"react": "19.0.0-rc-69d4b800-20241021",
2827
"react-dom": "19.0.0-rc-69d4b800-20241021",
2928
"react-hook-form": "7.52.0",
29+
"server-only": "^0.0.1",
3030
"sonner": "^1.7.0",
3131
"tailwind-merge": "^2.5.4",
3232
"tailwindcss-animate": "^1.0.7",
@@ -35,12 +35,18 @@
3535
"zod": "3.23.8"
3636
},
3737
"devDependencies": {
38+
"@next/eslint-plugin-next": "15.0.3",
3839
"@types/node": "20.14.9",
3940
"@types/react": "npm:[email protected]",
4041
"@types/react-dom": "npm:[email protected]",
42+
"@typescript-eslint/eslint-plugin": "7.14.1",
43+
"@typescript-eslint/parser": "7.14.1",
4144
"eslint": "8.57.0",
42-
"eslint-config-next": "15.0.3",
45+
"eslint-config-biome": "1.9.3",
46+
"eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
47+
"knip": "5.37.0",
4348
"postcss": "8.4.49",
49+
"postcss-load-config": "^6.0.1",
4450
"tailwindcss": "3.4.15",
4551
"typescript": "5.6.3"
4652
}

apps/wallet-ui/postcss.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ const config = {
55
},
66
};
77

8-
export default config;
8+
export default config;

apps/wallet-ui/src/app/[ecosystem]/(authed)/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ConnectButton from "@/components/ConnectButton";
2+
import { Image } from "@/components/ui/image";
23
import { authedOnly } from "@/lib/auth";
34
import { getEcosystemInfo } from "@/lib/ecosystems";
45
import { resolveScheme } from "thirdweb/storage";
@@ -12,14 +13,14 @@ export default async function Layout(props: {
1213

1314
const { children } = props;
1415

15-
await authedOnly();
16+
await authedOnly(params.ecosystem);
1617
const ecosystem = await getEcosystemInfo(params.ecosystem);
1718
return (
1819
<div className="flex w-full flex-col items-stretch">
1920
<header className="hidden w-full border-accent border-b bg-card py-4 sm:block">
2021
<div className="container mx-auto flex justify-between">
2122
<div className="flex items-center gap-2">
22-
<img
23+
<Image
2324
className="h-8 w-8"
2425
src={resolveScheme({ uri: ecosystem.imageUrl, client })}
2526
alt={ecosystem.name}

apps/wallet-ui/src/app/[ecosystem]/(authed)/wallet/[address]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ export default async function Page(props: {
66
params: Promise<{ address: string }>;
77
searchParams: Promise<{ chainId?: string; uri?: string }>;
88
}) {
9-
const searchParams = await props.searchParams;
9+
const [searchParams, params] = await Promise.all([
10+
props.searchParams,
11+
props.params,
12+
]);
1013

1114
const { chainId, uri } = searchParams;
12-
13-
const params = await props.params;
14-
1515
const { address } = params;
1616

1717
return (

0 commit comments

Comments
 (0)