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

fix/explorer-icons #1549

Merged
merged 11 commits into from
Nov 9, 2023
Merged

fix/explorer-icons #1549

merged 11 commits into from
Nov 9, 2023

Conversation

bigboydiamonds
Copy link
Collaborator

@bigboydiamonds bigboydiamonds commented Nov 8, 2023

Summary by CodeRabbit

  • New Features
    • Updated the display of blockchain explorer images and links.
  • Refactor
    • Enhanced handling of transaction data in the MostRecentTransaction component.
  • Chores
    • Added console log statements for debugging purposes.

e2a0265671dc954cce3a1b6dde459bd6c05c9c88: synapse-interface preview link
9e49e01cd6a147c2a6d321e7e81be8d61fa2720a: synapse-interface preview link
8741647344f758eb3259814f5b1b1fe65c1d1abd: synapse-interface preview link
dca5442dda9b6d0edccb0f50292f244d6f196090: synapse-interface preview link
eaecd72ac240271406becb2664441f0c7501ae97: synapse-interface preview link
4382d21f1c5560ec9236ac1eb53246bca50ea1e0: synapse-interface preview link
7143cea36a819452eec22d50370e420896774ead: synapse-interface preview link
03fd33bfaf8ad4a0ef788ffa286761218d2599dc: synapse-interface preview link
91baa6d136ce521005724d9141bf6d8ceff459da: synapse-interface preview link
875afea83c5846b72b83407378e4e5a7a90155fc: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Nov 8, 2023

Note

Reviews Paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The changes primarily revolve around the handling and display of blockchain explorer images and transaction data in various components. They include the addition of console logs for debugging, the use of optional chaining for safer property access, and the modification of image source attributes.

Changes

File Path Change Summary
.../chains/master.tsx Updated the explorerImg property of the POLYGON object.
.../PortfolioTokenAsset.tsx
.../PendingTransaction.tsx
.../MostRecentTransaction.tsx
.../TransactionStatusDetails
Added console logs for debugging and modified image source attributes. Updated handling of transaction properties, allowing for optional chaining and removing unnecessary type assertions.

Poem

🐇 Hopping through the code, with changes in our stride,
In the season of the fall, there's nowhere to hide.
Images and transactions, handled with care,
Console logs for debugging, placed here and there.
🍁 As leaves fall gently, we update our script,
Ensuring our blockchain journey is perfectly equipped.
On this day in history, the Berlin Wall fell,
Just like barriers in our code, we bid farewell.
🎉 Celebrating changes, in the cool autumn breeze,
Our code rabbit hops on, coding with ease.


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@bigboydiamonds bigboydiamonds changed the title fix/explorer-icons [do not merge] fix/explorer-icons Nov 8, 2023
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c1f8150 and d6cacb1.
Files selected for processing (1)
  • packages/synapse-interface/constants/chains/master.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/synapse-interface/constants/chains/master.tsx

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1d27fee) 51.23324% compared to head (bb2f3ec) 51.23324%.
Report is 7 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##              master       #1549   +/-   ##
=============================================
  Coverage   51.23324%   51.23324%           
=============================================
  Files            362         362           
  Lines          24691       24691           
  Branches         283         283           
=============================================
  Hits           12650       12650           
  Misses         10813       10813           
  Partials        1228        1228           
Flag Coverage Δ
packages 91.00610% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Nov 8, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb2f3ec
Status: ✅  Deploy successful!
Preview URL: https://38548b70.sanguine.pages.dev
Branch Preview URL: https://fe-explorer-icon-fix.sanguine.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d6cacb1 and e47dc73.
Files selected for processing (2)
  • packages/synapse-interface/components/Portfolio/PortfolioContent/components/PortfolioTokenAsset.tsx (1 hunks)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
  • packages/synapse-interface/components/Portfolio/PortfolioContent/components/PortfolioTokenAsset.tsx
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e47dc73 and ad8eeb2.
Files selected for processing (1)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ad8eeb2 and ed66057.
Files selected for processing (2)
  • packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx (3 hunks)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2 hunks)
Additional comments: 4
packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx (3)
  • 160-166: The startedTimestamp property is now being assigned either transaction.timestamp or transaction.id if transaction.timestamp is not available. Ensure that transaction.id is a valid timestamp.

  • 174-183: Optional chaining has been added to the properties of transaction to prevent potential undefined errors. This is a good practice for handling potentially undefined properties.

  • 218-230: Optional chaining has been added to the properties of transaction to prevent potential undefined errors. This is a good practice for handling potentially undefined properties.

packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (1)
  • 388-394: The src attribute of the Image component is using optional chaining for originChain.explorerImg. This is a good practice as it prevents runtime errors if originChain or explorerImg is undefined. However, ensure that there is appropriate error handling or a default image in case originChain?.explorerImg is undefined.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ed66057 and e79ba97.
Files selected for processing (1)
  • packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2 hunks)
Additional comments: 1
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (1)
  • 388-394: The Image component is using optional chaining for src attribute. This is a good practice to avoid potential null reference errors. However, ensure that there is a valid placeholder or default image to be used when originChain?.explorerImg?.src is null or undefined.

@bigboydiamonds
Copy link
Collaborator Author

@coderabbitai pause

@github-actions github-actions bot added size/s and removed size/xs labels Nov 9, 2023
@bigboydiamonds bigboydiamonds changed the title [do not merge] fix/explorer-icons fix/explorer-icons Nov 9, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't need this anymore

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed in bb2f3ec

@@ -181,7 +181,7 @@ export const POLYGON: Chain = {
nativeCurrency: { name: 'Matic', symbol: 'MATIC', decimals: 18 },
explorerUrl: 'https://polygonscan.com',
explorerName: 'PolygonScan',
explorerImg: polygonExplorerImg,
explorerImg: polygonImg,
Copy link
Collaborator

@abtestingalpha abtestingalpha Nov 9, 2023

Choose a reason for hiding this comment

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

We're using the SVG in @assets/chains/... vs @assets/explorer/... here, meaning can we do that throughout so we don't have duplicates?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for catching this! I was just testing out a few diff things to try and get the .png file to work. Didn't end up working so I converted all of @assets/explorer/ files from .png to .svg

Switched back in dde17ad

@bigboydiamonds bigboydiamonds merged commit 35affea into master Nov 9, 2023
44 checks passed
@bigboydiamonds bigboydiamonds deleted the fe/explorer-icon-fix branch November 9, 2023 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants