-
Notifications
You must be signed in to change notification settings - Fork 544
Feat: tokenAddress and amount bridge params #7176
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
…perience - Added `constants.ts` to configure Thirdweb client for the bridge application. - Created `BridgeLayout` component to structure the bridge page layout. - Developed `BridgePage` to handle the main functionality of the Universal Bridge, including metadata and dynamic content. - Introduced `Providers.client.tsx` to wrap the application with necessary context providers. - Implemented `UniversalBridgeEmbed` component for embedding payment functionalities with theme support. This commit establishes the foundational components for the Universal Bridge feature, improving the overall user interface and experience.
- Added specific error messages for insufficient native funds in both `SwapConfirmationScreen` and `TransferConfirmationScreen`. - Improved user feedback by providing clear titles and messages when transactions cannot be approved or confirmed due to lack of funds for gas.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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. |
""" WalkthroughThe changes update the bridge page and its embedded component to accept and handle additional query parameters for token address and amount, fetch token metadata, and pass these as props. UI adjustments were also made to the webhook table, centering specific columns and modifying the default version string display. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BridgePage
participant Blockchain
participant UniversalBridgeEmbed
User->>BridgePage: Loads page with searchParams (chainId, tokenAddress, amount)
BridgePage->>Blockchain: Fetch token metadata if chainId and tokenAddress present
Blockchain-->>BridgePage: Returns token metadata
BridgePage->>UniversalBridgeEmbed: Passes chainId, token, and amount as props
UniversalBridgeEmbed->>UniversalBridgeEmbed: Renders PayEmbed with prefilled token and amount
Possibly related PRs
Suggested labels
Suggested reviewers
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7176 +/- ##
==========================================
- Coverage 55.67% 55.66% -0.01%
==========================================
Files 904 904
Lines 58391 58391
Branches 4119 4113 -6
==========================================
- Hits 32510 32505 -5
- Misses 25775 25780 +5
Partials 106 106
🚀 New features to boost your workflow:
|
Merge activity
|
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/universal-bridge/webhooks/components/webhooks.client.tsx
(2 hunks)apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx
(2 hunks)apps/dashboard/src/app/bridge/page.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/universal-bridge/webhooks/components/webhooks.client.tsx (1)
114-115
: LGTM! Good UI consistency improvements.The centering of Version and Delete columns improves table readability, and changing the default version display from "v1" to "1" maintains consistency with the form's version selection values.
Also applies to: 126-129
apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx (2)
4-4
: Good addition of TokenInfo type import.The import is properly structured and enables type safety for the new token prop.
9-13
: Excellent implementation of dynamic token and amount support.The component now accepts token metadata and amount as props, making it more flexible than the previous hardcoded approach. The prop types are appropriate and the integration with PayEmbed is clean.
Also applies to: 24-25
apps/dashboard/src/app/bridge/page.tsx (2)
3-8
: Good addition of necessary imports for token metadata functionality.The imports are appropriate for the new token metadata fetching functionality.
46-58
: Good integration of dynamic token and amount props.The conditional token object creation and prop passing to
UniversalBridgeEmbed
is well structured. The fallback to "0.01" for amount is reasonable.
size-limit report 📦
|
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: greg <gregfromstl@gmail.com>
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: 0
♻️ Duplicate comments (2)
apps/dashboard/src/app/bridge/page.tsx (2)
26-26
: Input validation for URL parameters is still missing.This is the same issue flagged in previous reviews. The
tokenAddress
andchainId
parameters should be validated before use to prevent runtime errors.
36-37
: Remove redundant ESLint disable comment.This issue was flagged in previous reviews. The
no-restricted-syntax
disable comment is unnecessary and should be removed.
🧹 Nitpick comments (1)
apps/dashboard/src/app/bridge/page.tsx (1)
28-46
: Improve variable declarations for better type safety.The error handling implementation addresses previous feedback well. However, the variable declarations can be improved based on static analysis feedback.
Apply this diff to improve variable declarations:
- // Replace the existing destructuring block with error‐handled fetch - let symbol, decimals, tokenName; + // Replace the existing destructuring block with error‐handled fetch + let symbol: string | undefined; + let decimals: number | undefined; + let tokenName: string | undefined;🧰 Tools
🪛 Biome (1.9.4)
[error] 29-30: Declare variables separately
Unsafe fix: Break out into multiple declarations
(lint/style/useSingleVarDeclarator)
[error] 29-29: This variable implicitly has the any type.
Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.
(lint/suspicious/noImplicitAnyLet)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/dashboard/src/app/bridge/page.tsx
(2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
apps/dashboard/src/app/bridge/page.tsx
[error] 29-30: Declare variables separately
Unsafe fix: Break out into multiple declarations
(lint/style/useSingleVarDeclarator)
[error] 29-29: This variable implicitly has the any type.
Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.
(lint/suspicious/noImplicitAnyLet)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/app/bridge/page.tsx (2)
3-6
: Import statements look good.The new imports are properly utilized for the token metadata fetching functionality.
Also applies to: 8-8
51-63
: Component prop implementation looks good.The conditional token prop creation and amount defaulting logic properly handles both success and failure cases from the metadata fetching.
- Updated variable declarations for symbol, decimals, and tokenName to include explicit types. - Improved error handling for token metadata fetching with consistent logging format.
PR-Codex overview
This PR updates the
webhooks.client.tsx
,UniversalBridgeEmbed.tsx
, andpage.tsx
files to enhance the UI and functionality of the webhook management and the Universal Bridge component, including changes to table headers, cell formatting, and the addition of token metadata handling.Detailed summary
webhooks.client.tsx
to center-align "Version" and "Delete" table headers and cells.UniversalBridgeEmbed
function to accepttoken
andamount
as props.page.tsx
, including error handling.UniversalBridgeEmbed
invocation to pass token and amount props.Summary by CodeRabbit
New Features
Enhancements