Skip to content
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

Chain Badge consolidation & backend delivery #6328

Merged
merged 58 commits into from
Jan 17, 2025

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Dec 12, 2024

WHEN REVIEWING FILES, MAKE SURE YOU FILTER OUR .png / .json FILES

Blocked until #6344 lands as we currently rely on local ios imagesets for chain selectors.

What changed (plus any additional context for devs)

1. Badge System Refactoring

Changes to Chain Badge Implementation

  • Removed the old badge system that used static image assets in ios/Images.xcassets/badges/
  • Replaced ChainBadge component with new ChainImage component
  • Switched from local image assets to remote image URLs for chain badges
  • Added new getChainsBadge() method to backendNetworksStore to manage badge URLs

Component Updates

  • Updated all components that previously used ChainBadge or EthCoinIcon to use the new ChainImage component, including:
    • WalletConnectApprovalSheet
    • TransactionDetailsValueAndFeeSection
    • MintSheet
    • ClaimCustomization
    • FastTransactionCoinRow
    • And many others

2. Image Caching Improvements

FastImage Integration

  • Added FastImage cache clearing in multiple places:
    • Added to model migrations (v24)
    • Updated clearImageCache function in DevSection to clear both ImgixImage and FastImage caches
try {
  FastImage.clearDiskCache();
  FastImage.clearMemoryCache();
} catch (e) {
  logger.error(new RainbowError(`Error clearing FastImage cache: ${e}`));
}

3. Menu System Updates

Dropdown Menu Refactoring

  • Renamed DropdownMenu to ClaimableMenu in claimables section
  • Updated menu item interfaces to support remote icons
  • Improved handling of menu actions and selections
  • Added better TypeScript typing for menu configurations

4. UI/UX Improvements

Chain Badge Positioning

  • Added explicit chain badge positioning through a new prop:
chainBadgePosition: {
  x: number;
  y: number;
}
  • Improved consistency of badge placement across the app

Component Cleanup

  • Removed unused imports and components
  • Simplified component props
  • Improved type safety across components

This PR represents a significant refactoring of the chain badge system, moving from static assets to remote images while improving the overall architecture and maintainability of the codebase.

Screen recordings / screenshots

// wip

What to test

TestFlight: 1.9.50 (3)
https://www.notion.so/rainbowdotme/App-Chain-Image-QA-Checklist-15fb001b85b480839cb1e0cf1665de12

@brunobar79 brunobar79 added the release for release blockers and release candidate branches label Dec 12, 2024
@walmat walmat removed the release for release blockers and release candidate branches label Dec 13, 2024
@walmat walmat marked this pull request as ready for review December 17, 2024 18:42
@brunobar79
Copy link
Member

Launch in simulator or device for 31c82d1

@walmat walmat added the blocked Blocked by anything (design, UI work, other task, etc) label Dec 17, 2024
@brunobar79
Copy link
Member

Launch in simulator or device for 5f8f028

@brunobar79
Copy link
Member

Launch in simulator or device for a282bd6

Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunobar79
Copy link
Member

Launch in simulator or device for d8afaab

@derHowie derHowie self-requested a review January 17, 2025 22:08
Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd round lgtm

@derHowie derHowie merged commit 6249021 into develop Jan 17, 2025
6 of 8 checks passed
@derHowie derHowie deleted the @matthew/backend-chain-badge branch January 17, 2025 22:26
ibrahimtaveras00 added a commit that referenced this pull request Jan 17, 2025
* start work on backend driven chain badge

* Update src/components/expanded-state/AvailableNetworksv2.tsx

* consolidate SwapCoinIcon into RainbowCoinIcon

* replace ChainBadge with ChainImage and consolidate + cleanup

* fix missing native asset icon URL from swaps

* more badge sizing fixes

* add migration and clearing of FastImage cache in dev section to fix mainnet sizing

* fix lint

* fix up swaps

* address more swaps nuances

* more sizing issues fixed

* remove size={40} from RainbowCoinIcon as it's default

* Convert Chain Selection DropdownMenu to Backend Networks (#6344)

* start work on converting existing chain selection dropdowns to Zeego

* available networks v2 convert

* add token icons to claim dropdown and fix but with AvailableNetworks not showing ever

* latest changes to try to get hitslop to work

* refactor trending tokens to remove SwapCoinIcon and fix APP-2217

* fix APP-2218

* chain badge sizing fix on sign transaction sheet

* remove debug layouts

* fixes

* remove hitslop prop and bake it into children

* remove hitslop prop from claimable menu

* port over Kane's work for dropdown menu

* fix instances of menu item being checkbox

* Fix most chain badge issues

* Remove unrelated change

* Update src/components/expanded-state/asset/ChartExpandedState.js

* fix radial gradient color issue + spacing fix

* Fix network switcher badges

* Remove unused RainbowCoinIcon styles

* Fix EthCard mainnet icon

* Fix MintSheet chain badge

* Fix GasSpeedButton legacy network chain badge

* fix ClaimCustomization badge invalid size and position

* Fix MintsSheet chain badges

* Fix L2Disclaimer network name casing

* fix transaction details row size change

* fix SignTransactionSheet size change

* fix WalletConnectApprovalSheet position relative

* revert animated coin icon changes

* revert changes

* revert collectible send row position change

* fix WalletConnectV2ListItem

* remove change to useWallets

* fix AddCash ProviderCard

* cleanup unused vars in ClaimCustomization

* fix two coin icons sizing and position on transaction details row

---------

Co-authored-by: Ibrahim Taveras <[email protected]>
Co-authored-by: Christian Baroni <[email protected]>
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.

5 participants