-
Notifications
You must be signed in to change notification settings - Fork 39
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
add $
to ether price
#1694
Conversation
WalkthroughThe update to the Changes
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 ? TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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", |
There was a problem hiding this comment.
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.
value: `$${price?.ethereum?.usd}` || "N/A", | |
value: price?.ethereum?.usd ? `$${price.ethereum.usd}` : "N/A", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this 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
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
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