-
Notifications
You must be signed in to change notification settings - Fork 590
[BLD-330] Playground: Add missing payments overview page #8107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
WalkthroughAdds a Payments overview page at /payments, appends an x402 payments feature card to paymentsFeatureCards, and constrains the OverviewPage description width via a max-w class. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Router as Next.js Router
participant Page as /payments Page
participant Data as pages-metadata (paymentsFeatureCards)
participant View as OverviewPage
User->>Router: Navigate to /payments
Router->>Page: render Page()
Page->>Data: import paymentsFeatureCards
Page->>View: render OverviewPage(title, description, featureCards, PayIcon)
View-->>User: display overview with feature cards (includes x402)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8107 +/- ##
=======================================
Coverage 56.32% 56.32%
=======================================
Files 906 906
Lines 59197 59197
Branches 4179 4179
=======================================
Hits 33345 33345
Misses 25747 25747
Partials 105 105
🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
apps/playground-web/src/components/blocks/OverviewPage.tsx (3)
22-24
: Make the description width responsive (avoid cramped mobile).Apply the constraint from md↑ to keep mobile full-width.
- <p className="text-base text-muted-foreground leading-normal text-pretty max-w-[80%]"> + <p className="text-base text-muted-foreground leading-normal text-pretty md:max-w-[80%]">
4-10
: Add explicit return type.Aligns with our TS guidelines.
-export function OverviewPage(props: { +export function OverviewPage(props: { featureCards: FeatureCardMetadata[]; title: string; description: React.ReactNode; icon: React.FC<{ className?: string }>; -}) { +}): JSX.Element {
28-36
: Use a stable key (link) instead of title.Links are more stable/unique than titles.
- <FeatureCard - key={card.title} + <FeatureCard + key={card.link} description={card.description} href={card.link} icon={card.icon} title={card.title} />apps/playground-web/src/app/payments/page.tsx (2)
1-3
: Mark server component explicitly.Add server-only guard per app guidelines.
+import "server-only"; import { OverviewPage } from "@/components/blocks/OverviewPage"; import { PayIcon } from "@/icons/PayIcon"; import { paymentsFeatureCards } from "../data/pages-metadata";
5-14
: Add explicit return type.Keep TS explicit for pages.
-export default function Page() { +export default function Page(): JSX.Element { return ( <OverviewPage title="Payments" description="thirdweb Payments allow developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more" featureCards={paymentsFeatureCards} icon={PayIcon} /> ); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
apps/playground-web/src/app/data/pages-metadata.ts
(2 hunks)apps/playground-web/src/app/payments/page.tsx
(1 hunks)apps/playground-web/src/components/blocks/OverviewPage.tsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}
: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/types
or localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial
,Pick
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}
: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/types
where applicable
Prefertype
aliases overinterface
except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
apps/playground-web/src/components/blocks/OverviewPage.tsx
apps/playground-web/src/app/payments/page.tsx
apps/playground-web/src/app/data/pages-metadata.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/playground-web/src/components/blocks/OverviewPage.tsx
apps/playground-web/src/app/payments/page.tsx
apps/playground-web/src/app/data/pages-metadata.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}
: Import UI primitives from@/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLink
for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()
from@/lib/utils
for conditional class logic
Use design system tokens (e.g.,bg-card
,border-border
,text-muted-foreground
)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()
to retrieve JWT from cookies on server side
UseAuthorization: Bearer
header – never embed tokens in URLs
Return typed results (e.g.,Project[]
,User[]
) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query
)
Use descriptive, stablequeryKeys
for React Query cache hits
ConfigurestaleTime
/cacheTime
in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-js
in server components
Files:
apps/playground-web/src/components/blocks/OverviewPage.tsx
apps/playground-web/src/app/payments/page.tsx
apps/playground-web/src/app/data/pages-metadata.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout PR #7888.
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout changes.
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use the `container` class with a `max-w-7xl` cap for page width consistency.
Applied to files:
apps/playground-web/src/components/blocks/OverviewPage.tsx
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout changes.
Applied to files:
apps/playground-web/src/app/payments/page.tsx
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout PR #7888.
Applied to files:
apps/playground-web/src/app/payments/page.tsx
🧬 Code graph analysis (1)
apps/playground-web/src/app/payments/page.tsx (3)
apps/playground-web/src/components/blocks/OverviewPage.tsx (1)
OverviewPage
(4-40)apps/playground-web/src/app/data/pages-metadata.ts (1)
paymentsFeatureCards
(168-197)apps/playground-web/src/icons/PayIcon.tsx (1)
PayIcon
(1-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/playground-web/src/app/data/pages-metadata.ts (2)
7-7
: LGTM on icon import.Import matches usage in the new card.
190-196
: No action — /payments/x402 route existsRoute implemented at apps/playground-web/src/app/payments/x402/page.tsx; the card link is valid.
return ( | ||
<OverviewPage | ||
title="Payments" | ||
description="thirdweb Payments allow developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick
Minor grammar fix in description.
Subject-verb agreement.
- description="thirdweb Payments allow developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more"
+ description="thirdweb Payments allows developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
description="thirdweb Payments allow developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more" | |
description="thirdweb Payments allows developers to create advanced payment flows to monetize their apps through product sales, peer to peer payments, token sales, and more" |
🤖 Prompt for AI Agents
In apps/playground-web/src/app/payments/page.tsx around line 9, the description
string has incorrect subject-verb agreement ("thirdweb Payments allow...");
update it to use the correct verb form by changing "allow" to "allows" so the
sentence reads "thirdweb Payments allows developers to create advanced payment
flows to monetize their apps through product sales, peer to peer payments, token
sales, and more".
Merge activity
|
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new `OverviewPage` component for the payments section, updates the layout of the `OverviewPage`, and adds a new payment feature card for the x402 payment protocol. ### Detailed summary - Updated `OverviewPage` to allow a maximum width of 80% for the description. - Created a new `Page` component in `page.tsx` that utilizes `OverviewPage` with a title, description, and feature cards. - Added a new feature card for the x402 payment protocol in `pages-metadata.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a Payments page with a clear overview, icon, and quick links to payment options. * Added an x402 payment protocol card to the Payments overview, enabling API payments with any web3 wallet and direct navigation. * **Style** * Refined overview layout by limiting description width for improved readability on wide screens. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
c3e8f76
to
db145b5
Compare
PR-Codex overview
This PR introduces a new
OverviewPage
component for the payments section, enhancing its layout and adding a new feature card related to the x402 payment protocol.Detailed summary
<p>
tag inOverviewPage.tsx
to limit its width to 80%.OverviewPage
component to thePage
function inpage.tsx
, with title and description for payments.pages-metadata.ts
.Summary by CodeRabbit
New Features
Style