Skip to content

Conversation

@PetarStoev02
Copy link
Contributor

Summary

  • Migrate BridgeWidget component to shadcn registry format
  • Extract types and utilities to separate files for better maintainability
  • Replace next/image with native img for framework-agnostic portability
  • Make networks, tokens, and fees configurable via props with sensible defaults
  • Add onBridge callback for custom bridge implementations

Changes

File Description
registry/w3-kit/bridge/bridge.tsx Main component with network selection, token selection, and bridge functionality
registry/w3-kit/bridge/types.ts TypeScript interfaces (Network, Token, BridgeWidgetProps, BridgeParams)
registry/w3-kit/bridge/utils.ts Default networks, tokens, fees, and animation constants
registry.json shadcn registry manifest
components.json shadcn configuration

Installation

npx shadcn@latest add @w3-kit/bridge

Test plan

  • Verify component renders correctly with default networks and tokens
  • Test network selection (from/to) with mutual exclusion
  • Test network switch button functionality
  • Test token selection and amount input
  • Test bridge confirmation flow
  • Verify custom onBridge callback works

Closes #3

- Create registry structure for @w3-kit/bridge component
- Extract types to separate file (Network, Token, BridgeWidgetProps, BridgeParams)
- Extract utilities to separate file (DEFAULT_NETWORKS, DEFAULT_TOKENS, DEFAULT_TOKEN_FEES)
- Replace next/image with native img for portability
- Make networks, tokens, and fees configurable via props
- Add onBridge callback for custom bridge implementations
- Add registry.json and components.json for shadcn configuration

Component can be installed via: npx shadcn@latest add @w3-kit/bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Migration] Migrate BridgeWidget to shadcn registry

2 participants