refactor: break down monolithic page component into reusable modules #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactoring
Breaks down the large
page.tsx
component into smaller, focused, and reusable components while preserving exact visual styling and functionality.Changes:
BackgroundEffects
component for visual effectsHeader
component for logo sectionConnectedWallet
component for wallet UIResourcesSection
component for footer cardsLoadingSpinner
component for loading stateuseContract
hook for contract logicStructure:
src/
├── components/
│ ├── icons/
│ │ └── Icons.tsx
│ ├── provider/
│ │ └── NextAbstractWalletProvider.tsx
│ ├── ui/
│ │ ├── BackgroundEffect.tsx
│ │ ├── Button.tsx
│ │ └── LoadingSpinner.tsx
│ ├── wallet/
│ │ ├── ConnectWallet.tsx
│ │ ├── WalletInfo.tsx
│ │ ├── WalletActions.tsx
│ │ └── TransactionResult.tsx
│ ├── Header.tsx
│ ├── ResourceCard.tsx
│ └── ResourcesSection.tsx
├── hooks/
│ └── useContract.ts
└── app/
└── page.tsx (simplified)
Benefits:
No visual changes - purely structural improvements.
PR-Codex overview
This PR introduces new components and refactors existing ones in the
agw-connectkit-nextjs
project. It enhances the UI with loading indicators, background effects, and transaction result displays, while reorganizing the wallet provider path and streamlining the main page structure.Detailed summary
LoadingSpinner
component for loading animations.BackgroundEffects
component for visual enhancements.TransactionResult
andWalletInfo
components to display transaction details and wallet address.NextAbstractWalletProvider
path.Header
andResourcesSection
components for better structure.ConnectedWallet
component to display transaction status.ResourceCard
component for resource links.WalletActions
component.