Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit ecc7ced

Browse files
authored
app router + chainlist + chain page + shadcn ui (#2541)
<!-- start pr-codex --> ## PR-Codex overview This PR updates various dependencies, removes unused files, refactors code structure, and improves component organization. ### Detailed summary - Removed unused files and components - Updated PostCSS configuration - Refactored code for better organization - Added new constants and utility functions - Updated components with new imports - Improved error handling and global error component - Updated theme provider and header links - Modified sidebar functionality - Updated TypeScript settings - Enhanced button components and tables - Added new chain-related functions and components > The following files were skipped due to too many changes: `src/pages/profile/[profileAddress].tsx`, `src/@/components/ui/Spinner/Spinner.module.css`, `src/app/components/posthog-pageview.tsx`, `src/@/components/ui/separator.tsx`, `src/@/components/ui/label.tsx`, `src/pages/publish/[...paths].tsx`, `src/@/components/color-mode-toggle.tsx`, `src/@/components/ui/ScrollShadow/ScrollShadow.module.css`, `src/@/components/ui/input.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/engine/page.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/pay/page.tsx`, `src/app/(dashboard)/providers.tsx`, `src/lib/v5-adapter.ts`, `src/@/components/ui/CopyButton.tsx`, `src/app/(dashboard)/(chain)/components/server/products.ts`, `src/app/(dashboard)/(chain)/[chain_id]/components/server/info-card.tsx`, `src/pages/[chainSlug]/[...paths].tsx`, `src/app/components/DashboardFooter.tsx`, `src/@/components/ui/checkbox.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/components/server/explorer-section.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/rpc-edge/page.tsx`, `src/@/components/ui/popover.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/components/client/tabs.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/components/server/faucets-section.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/client/view.tsx`, `src/app/components/Header/MobileBurgerMenu.tsx`, `src/pages/_app.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/account-abstraction/page.tsx`, `src/@/components/ui/radio-group.tsx`, `src/lib/thirdweb-client.ts`, `src/contexts/configured-chains.tsx`, `src/@/styles/globals.css`, `src/@/components/ui/tooltip.tsx`, `src/@/components/ui/button.tsx`, `src/@/components/ui/card.tsx`, `src/app/(dashboard)/(chain)/components/server/icons/PayIcon.tsx`, `src/app/components/Header/DashboardHeader.tsx`, `src/app/layout.tsx`, `src/app/(dashboard)/(chain)/components/server/icons/ConnectSDKIcon.tsx`, `tailwind.config.js`, `src/app/(dashboard)/(chain)/components/server/icons/ContractIcon.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/client/search.tsx`, `src/app/(dashboard)/(chain)/components/server/icons/RPCIcon.tsx`, `src/@/components/ui/tabs.tsx`, `src/app/(dashboard)/styleguide/page.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/connect-sdk/page.tsx`, `src/app/components/ThirdwebMiniLogo.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/client/pagination.tsx`, `src/app/(dashboard)/(chain)/components/server/icons/SmartAccountIcon.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-row.tsx`, `src/app/(dashboard)/(chain)/components/client/star-button.tsx`, `src/@/components/ui/pagination.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-card.tsx`, `src/@/components/ui/ScrollShadow/ScrollShadow.tsx`, `src/app/(dashboard)/(chain)/components/server/icons/EngineIcon.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/page.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/rpc-edge/components/client/live-stats.tsx`, `src/components/app-layouts/provider-setup.tsx`, `src/app/(dashboard)/(chain)/components/server/chain-icon.tsx`, `next.config.js`, `package.json`, `src/components/selects/CustomChainRenderer.tsx`, `src/app/(dashboard)/(chain)/[chain_id]/layout.tsx`, `src/components/app-layouts/providers.tsx`, `src/@3rdweb-sdk/react/components/connect-wallet/index.tsx`, `src/app/(dashboard)/(chain)/chainlist/page.tsx`, `src/app/(dashboard)/(chain)/chainlist/components/client/filters.tsx`, `pnpm-lock.yaml` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 99bbb52 commit ecc7ced

File tree

107 files changed

+8018
-5194
lines changed

Some content is hidden

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

107 files changed

+8018
-5194
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
"import/no-default-export": "off",
4040
"import/no-useless-path-segments": "error",
4141
// react
42-
"react/forbid-dom-props": ["error", { forbid: ["className", "style"] }],
42+
"react/forbid-dom-props": ["error", { forbid: ["style"] }],
4343
"react/no-children-prop": "off",
4444
"react/prop-types": "off",
4545
// react-hooks

.vscode/settings.json

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
{
22
"typescript.tsdk": "./node_modules/typescript/lib",
33
"typescript.enablePromptUseWorkspaceTsdk": true,
4-
"cSpell.words": [
5-
"chakra",
6-
"dismissable",
7-
"hookform",
8-
"JWKS",
9-
"onboarded",
10-
"Posthog",
11-
"rdweb",
12-
"solana",
13-
"tanstack",
14-
"Thirdweb",
15-
"usedapp"
16-
]
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.formatOnSave": true,
6+
"typescript.preferences.importModuleSpecifier": "project-relative",
7+
"editor.quickSuggestions": {
8+
"strings": "on"
9+
}
1710
}

components.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/global.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

next-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference types="next/navigation-types/compat/navigation" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

+68-45
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,33 @@ function determineIpfsGateways() {
8585

8686
/** @type {import('next').NextConfig} */
8787
const moduleExports = {
88+
webpack: (config, { dev }) => {
89+
if (config.cache && !dev) {
90+
config.cache = Object.freeze({
91+
type: "memory",
92+
});
93+
config.cache.maxMemoryGenerations = 0;
94+
}
95+
config.externals.push("pino-pretty");
96+
config.module = {
97+
...config.module,
98+
exprContextCritical: false,
99+
};
100+
// Important: return the modified config
101+
return config;
102+
},
88103
async headers() {
89104
return [
90105
{
91106
// Apply these headers to all routes in your application.
92107
source: "/(.*)",
93-
headers: securityHeaders,
108+
headers: [
109+
...securityHeaders,
110+
{
111+
key: "accept-ch",
112+
value: "sec-ch-viewport-width",
113+
},
114+
],
94115
},
95116
];
96117
},
@@ -122,21 +143,19 @@ const moduleExports = {
122143
},
123144
reactStrictMode: true,
124145
experimental: {
125-
instrumentationHook: true,
126146
scrollRestoration: true,
127147
esmExternals: "loose",
128148
webpackBuildWorker: true,
149+
serverSourceMaps: false,
129150
},
151+
cacheMaxMemorySize: 0,
152+
swcMinify: true,
130153
compiler: {
131154
emotion: true,
132155
},
133-
productionBrowserSourceMaps: true,
156+
productionBrowserSourceMaps: false,
134157
};
135158

136-
const withBundleAnalyzer = require("@next/bundle-analyzer")({
137-
enabled: process.env.ANALYZE === "true",
138-
});
139-
140159
const { withSentryConfig } = require("@sentry/nextjs");
141160

142161
const { withPlausibleProxy } = require("next-plausible");
@@ -149,43 +168,47 @@ module.exports = withPlausibleProxy({
149168
customDomain: "https://pl.thirdweb.com",
150169
scriptName: "pl",
151170
})(
152-
withBundleAnalyzer(
153-
wSentry(
154-
moduleExports,
155-
{
156-
// For all available options, see:
157-
// https://github.com/getsentry/sentry-webpack-plugin#options
158-
159-
// Suppresses source map uploading logs during build
160-
silent: true,
161-
org: "thirdweb-dev",
162-
project: "dashboard",
163-
},
164-
{
165-
// For all available options, see:
166-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
167-
168-
// Upload a larger set of source maps for prettier stack traces (increases build time)
169-
widenClientFileUpload: true,
170-
171-
// Transpiles SDK to be compatible with IE11 (increases bundle size)
172-
transpileClientSDK: false,
173-
174-
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
175-
tunnelRoute: "/err",
176-
177-
// Hides source maps from generated client bundles
178-
hideSourceMaps: true,
179-
180-
// Automatically tree-shake Sentry logger statements to reduce bundle size
181-
disableLogger: true,
182-
183-
// Enables automatic instrumentation of Vercel Cron Monitors.
184-
// See the following for more information:
185-
// https://docs.sentry.io/product/crons/
186-
// https://vercel.com/docs/cron-jobs
187-
automaticVercelMonitors: true,
188-
},
189-
),
171+
wSentry(
172+
moduleExports,
173+
{
174+
// For all available options, see:
175+
// https://github.com/getsentry/sentry-webpack-plugin#options
176+
177+
// Suppresses source map uploading logs during build
178+
silent: true,
179+
org: "thirdweb-dev",
180+
project: "dashboard",
181+
},
182+
{
183+
// For all available options, see:
184+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
185+
186+
// Upload a larger set of source maps for prettier stack traces (increases build time)
187+
widenClientFileUpload: true,
188+
189+
// Transpiles SDK to be compatible with IE11 (increases bundle size)
190+
transpileClientSDK: false,
191+
192+
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
193+
tunnelRoute: "/err",
194+
195+
// Hides source maps from generated client bundles
196+
hideSourceMaps: true,
197+
198+
// Automatically tree-shake Sentry logger statements to reduce bundle size
199+
disableLogger: true,
200+
201+
// Enables automatic instrumentation of Vercel Cron Monitors.
202+
// See the following for more information:
203+
// https://docs.sentry.io/product/crons/
204+
// https://vercel.com/docs/cron-jobs
205+
automaticVercelMonitors: false,
206+
207+
/**
208+
* Disables the Sentry Webpack plugin on the server.
209+
* See: https://github.com/getsentry/sentry-javascript/issues/10468#issuecomment-2004710692
210+
*/
211+
disableServerWebpackPlugin: true,
212+
},
190213
),
191214
);

package.json

+51-35
Original file line numberDiff line numberDiff line change
@@ -26,106 +26,122 @@
2626
"@chakra-ui/react": "^2.8.2",
2727
"@chakra-ui/styled-system": "^2.9.2",
2828
"@chakra-ui/theme-tools": "^2.1.2",
29-
"@coinbase/onchainkit": "^0.14.1",
29+
"@coinbase/onchainkit": "^0.14.2",
3030
"@emotion/react": "^11.11.4",
3131
"@emotion/styled": "^11.11.5",
32-
"@hookform/resolvers": "^3.3.4",
32+
"@hookform/resolvers": "^3.6.0",
3333
"@n8tb1t/use-scroll-position": "^2.0.3",
34+
"@radix-ui/react-checkbox": "^1.0.4",
35+
"@radix-ui/react-label": "^2.0.2",
36+
"@radix-ui/react-popover": "^1.0.7",
37+
"@radix-ui/react-radio-group": "^1.1.3",
38+
"@radix-ui/react-separator": "^1.0.3",
39+
"@radix-ui/react-slot": "^1.0.2",
40+
"@radix-ui/react-tooltip": "^1.0.7",
3441
"@react-icons/all-files": "^4.1.0",
35-
"@sentry/nextjs": "^8.2.1",
42+
"@sentry/nextjs": "^8.8.0",
3643
"@stripe/react-stripe-js": "^2.7.1",
37-
"@stripe/stripe-js": "^3.4.1",
44+
"@stripe/stripe-js": "^3.5.0",
3845
"@tanstack/query-async-storage-persister": "^4.36.1",
3946
"@tanstack/react-query": "^4.36.1",
4047
"@tanstack/react-query-persist-client": "^4.36.1",
41-
"@tanstack/react-table": "^8.16.0",
42-
"@thirdweb-dev/chains": "0.1.111",
43-
"@thirdweb-dev/react": "4.6.24",
44-
"@thirdweb-dev/react-core": "4.6.24",
45-
"@thirdweb-dev/sdk": "4.0.85",
46-
"@thirdweb-dev/service-utils": "0.4.29",
48+
"@tanstack/react-table": "^8.17.3",
49+
"@thirdweb-dev/chains": "0.1.116",
50+
"@thirdweb-dev/react": "4.6.31",
51+
"@thirdweb-dev/react-core": "4.6.31",
52+
"@thirdweb-dev/sdk": "4.0.92",
53+
"@thirdweb-dev/service-utils": "0.4.30",
4754
"@thirdweb-dev/storage": "2.0.15",
48-
"@thirdweb-dev/wallets": "2.5.25",
55+
"@thirdweb-dev/wallets": "2.5.32",
4956
"@vercel/og": "^0.6.2",
5057
"airtable": "^0.12.2",
5158
"chakra-react-select": "^4.7.6",
59+
"class-variance-authority": "^0.7.0",
60+
"clsx": "^2.1.1",
5261
"color": "^4.2.3",
5362
"compare-versions": "^6.1.0",
5463
"date-fns": "^3.6.0",
5564
"ethers": "^5.7.2",
5665
"flat": "^6.0.1",
57-
"framer-motion": "^11.1.7",
66+
"framer-motion": "^11.2.10",
5867
"fuse.js": "^7.0.0",
5968
"graphql": "^16.8.1",
6069
"idb-keyval": "^6.2.1",
6170
"lottie-react": "^2.4.0",
62-
"next": "^14.2.3",
71+
"lucide-react": "^0.390.0",
72+
"next": "14.2.3",
6373
"next-plausible": "^3.12.0",
6474
"next-seo": "^6.5.0",
75+
"next-themes": "^0.3.0",
76+
"nextjs-toploader": "^1.6.12",
6577
"papaparse": "^5.4.1",
6678
"pluralize": "^8.0.0",
6779
"posthog-js": "1.128.3",
6880
"posthog-js-opensource": "npm:[email protected]",
69-
"prettier": "^3.2.5",
81+
"prettier": "^3.3.1",
7082
"prism-react-renderer": "^2.3.1",
7183
"prismjs": "^1.29.0",
7284
"qrcode": "^1.5.3",
73-
"react": "^18.3.1",
85+
"react": "18.3.1",
7486
"react-children-utilities": "^2.10.0",
75-
"react-dom": "^18.3.1",
87+
"react-dom": "18.3.1",
7688
"react-dropzone": "^14.2.3",
77-
"react-hook-form": "^7.51.3",
89+
"react-hook-form": "7.51.4",
7890
"react-icons": "^5.2.1",
79-
"react-intersection-observer": "^9.10.2",
91+
"react-intersection-observer": "^9.10.3",
8092
"react-markdown": "^9.0.1",
8193
"react-otp-input": "^3.1.1",
82-
"react-query-v5": "npm:@tanstack/react-query@^5.0.0",
94+
"react-query-v5": "npm:@tanstack/react-query@^5.40.1",
8395
"react-responsive-carousel": "^3.2.23",
8496
"react-table": "^7.8.0",
85-
"recharts": "^2.12.6",
97+
"recharts": "^2.12.7",
8698
"remark-gfm": "^4.0.0",
8799
"spdx-correct": "^3.2.0",
88100
"swagger-ui-react": "^5.17.14",
89-
"thirdweb": "5.22.1",
101+
"tailwind-merge": "^2.3.0",
102+
"tailwindcss-animate": "^1.0.7",
103+
"thirdweb": "5.28.0",
90104
"tiny-invariant": "^1.3.3",
91-
"zksync-ethers": "^5.7.2",
92-
"zod": "^3.23.4"
105+
"use-debounce": "^10.0.1",
106+
"zksync-ethers": "^5.8.0",
107+
"zod": "^3.23.8"
93108
},
94109
"devDependencies": {
95110
"@chakra-ui/cli": "^2.4.1",
96111
"@graphql-codegen/cli": "^5.0.2",
97-
"@graphql-codegen/typescript": "^4.0.6",
98-
"@graphql-codegen/typescript-operations": "^4.2.0",
112+
"@graphql-codegen/typescript": "^4.0.7",
113+
"@graphql-codegen/typescript-operations": "^4.2.1",
99114
"@graphql-codegen/typescript-react-apollo": "^4.3.0",
100115
"@next/bundle-analyzer": "^14.2.3",
101-
"@next/eslint-plugin-next": "^14.2.2",
102-
"@playwright/test": "^1.43.1",
116+
"@next/eslint-plugin-next": "^14.2.3",
117+
"@playwright/test": "^1.44.1",
103118
"@types/color": "^3.0.6",
104-
"@types/node": "^20.12.12",
119+
"@types/node": "^20.14.2",
105120
"@types/papaparse": "^5.3.14",
106121
"@types/pluralize": "^0.0.33",
107122
"@types/qrcode": "^1.5.5",
108-
"@types/react": "^18.3.1",
123+
"@types/react": "^18.3.3",
109124
"@types/react-dom": "^18.3.0",
110125
"@types/react-table": "^7.7.20",
111126
"@types/spdx-correct": "^3.1.3",
112127
"@types/swagger-ui-react": "^4.18.3",
113-
"@typescript-eslint/eslint-plugin": "^7.10.0",
114-
"@typescript-eslint/parser": "^7.8.0",
128+
"@typescript-eslint/eslint-plugin": "^7.12.0",
129+
"@typescript-eslint/parser": "^7.12.0",
130+
"autoprefixer": "^10.4.19",
115131
"checkly": "^4.6.3",
116132
"dotenv": "^16.4.5",
117133
"eslint": "^8.57.0",
118134
"eslint-config-prettier": "^9.1.0",
119135
"eslint-plugin-import": "^2.29.1",
120136
"eslint-plugin-inclusive-language": "^2.2.1",
121137
"eslint-plugin-prettier": "^5.1.3",
122-
"eslint-plugin-promise": "^6.1.1",
123-
"eslint-plugin-react": "^7.34.1",
138+
"eslint-plugin-promise": "^6.2.0",
139+
"eslint-plugin-react": "^7.34.2",
124140
"eslint-plugin-react-hooks": "^4.6.2",
125-
"knip": "^5.9.4",
141+
"knip": "^5.17.4",
126142
"next-sitemap": "^4.2.3",
127143
"next-unused": "^0.0.6",
128-
"tailwindcss": "^3.4.3",
144+
"tailwindcss": "^3.4.4",
129145
"typescript": "^5.4.5"
130146
},
131147
"pnpm": {

0 commit comments

Comments
 (0)