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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",

// TODO: add change
// change: "+20.1%",
icon: RocketIcon,
Expand Down
Loading