-
Notifications
You must be signed in to change notification settings - Fork 45
fix: #401 use (SOL) notation to prevent USD/coin amount confusion #402
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,7 +60,9 @@ export function GigCard({ | |||||||||||||
| const coin = gig.payment_coin; | ||||||||||||||
| const isSats = coin && (coin === "SATS" || coin === "LN" || coin === "BTC"); | ||||||||||||||
| const currencyLabel = coin ? (isSats ? "sats" : coin) : "USD"; | ||||||||||||||
| const coinNote = coin ? ` (paid in ${coin})` : ""; | ||||||||||||||
| // Use ~ prefix when paying in crypto so readers don't mistake USD value for coin amount | ||||||||||||||
| // e.g. "$1.00 USD (~SOL)" not "$1.00 USD (paid in SOL)" — ~ makes it clear it's an equivalent | ||||||||||||||
| const coinNote = coin ? ` (${coin})` : ""; | ||||||||||||||
|
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||
|
|
||||||||||||||
| const fmt = (val: number) => { | ||||||||||||||
| if (isSats) return `${val.toLocaleString("en-US")} sats`; | ||||||||||||||
|
|
@@ -75,7 +77,7 @@ export function GigCard({ | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (min && max && min !== max) return `${fmt(min)} - ${fmt(max)}${suffix}${!isSats ? coinNote : ""}`; | ||||||||||||||
| if (min && max) return `${fmt(min)}${suffix}${!isSats ? coinNote : ""}`; | ||||||||||||||
| if (min && max) return `${fmt(min)}${suffix}${!isSats ? " " + coinNote : ""}`; | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| if (min) return `${fmt(min)}+${suffix}${!isSats ? coinNote : ""}`; | ||||||||||||||
| if (max) return `up to ${fmt(max)}${suffix}${!isSats ? coinNote : ""}`; | ||||||||||||||
| return (gig.budget_type === "fixed" || gig.budget_type === "bounty") ? "Budget TBD" : "Rate TBD"; | ||||||||||||||
|
|
||||||||||||||
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.
(SOL) not (~SOL)but the code comments inGigCard.tsxstate the opposite — that~prefix is used. With the stale~comment removed from the source, the test comment should simply describe the expected format clearly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!