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

add $ to ether price #1694

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

Jennievon
Copy link
Contributor

Why this change is needed

Please provide a description and a link to the underlying ticket

What changes were made as part of this PR

Please provide a high level list of the changes made

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@Jennievon Jennievon self-assigned this Dec 12, 2023
Copy link

coderabbitai bot commented Dec 12, 2023

Walkthrough

The update to the Dashboard component in the obscuroscan_v3 project involves a minor yet visible change to the user interface. The modification ensures that the Ethereum price is now displayed with a preceding dollar sign, enhancing the clarity of the currency value presented to the users on the dashboard.

Changes

File Path Change Summary
.../dashboard/index.tsx Updated the Ethereum price display to include a dollar sign before the value.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment from CodeRabbit.
  • You can also chat with CodeRabbit bot directly around the specific lines of code or files in the PR by tagging @coderabbitai in a new comment.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Copy link

@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 c4c827d and 0ea28b0.
Files selected for processing (1)
  • tools/obscuroscan_v3/frontend/src/components/modules/dashboard/index.tsx (1 hunks)

@@ -39,7 +39,7 @@ export default function Dashboard() {
const DASHBOARD_DATA = [
{
title: "Ether Price",
value: price?.ethereum?.usd || "N/A",
value: `$${price?.ethereum?.usd}` || "N/A",
Copy link

Choose a reason for hiding this comment

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

The logic for displaying the Ether price with a dollar sign seems to be incorrect. The current implementation will not display "N/A" if price?.ethereum?.usd is null or undefined because the string concatenation will convert it to the string "$null" or "$undefined", which are truthy values in JavaScript. The "N/A" fallback will never be used.

- value: `$${price?.ethereum?.usd}` || "N/A",
+ value: price?.ethereum?.usd ? `$${price.ethereum.usd}` : "N/A",

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
value: `$${price?.ethereum?.usd}` || "N/A",
value: price?.ethereum?.usd ? `$${price.ethereum.usd}` : "N/A",

Copy link
Collaborator

@BedrockSquirrel BedrockSquirrel left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link

@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 0ea28b0 and 5b1e472.
Files selected for processing (1)
  • tools/obscuroscan_v3/frontend/src/components/modules/dashboard/index.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tools/obscuroscan_v3/frontend/src/components/modules/dashboard/index.tsx

@Jennievon Jennievon merged commit 457777e into main Dec 12, 2023
2 checks passed
@Jennievon Jennievon deleted the jennifer/add-dollar-sign-to-ether-price branch December 12, 2023 10:05
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.

2 participants