walnuthq / op-scan

Lightweight transaction explorer for the OP Stack.
7 stars 16 forks source link

feat: highlight equal addresses #22

Closed JoelVR17 closed 3 days ago

JoelVR17 commented 1 week ago

Feature: Highlight Equal Addresses | Issue #10


Description On a Transaction detail page, when a user hovers over an address, the address should be highlighted in a yellow-ish color. Other addresses on this page that are equal to the address being hovered should also be highlighted.

Changes

  1. Create a AddressProvider and AddressContext.

    • File: AddressContext.tsx
    • Description: Use these functions to provide the status of equal addresses in any part of the project, with AddressProviderwrapping the body in layout.tsx.
  2. Create a AddressLink

    • File: AddressLink.tsx
    • Description:
      • This component is for highlighting equal addresses with a yellow-ish dashed border.
      • If the href prop is an external link, then it shows an icon.
  3. Implement the AddressLink into latest-transactions

    • File: latest-transactions.tsx
    • Description:
      • Use the AddressLink component in From/To Addresses to highlight their equals.

Notes

  1. The AddressLink component can be used in any part of the project.

Images

  1. HighLight equal addresses (Dark Theme) image

  2. HighLight equal addresses (Light Theme) image

  3. External Icon image