Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Nov 25, 2024
1 parent fa1f448 commit 73ffd08
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/ui/src/ValueView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export interface ValueViewComponentProps<SelectedContext extends Context> {
*/
priority?: PillProps['priority'];
/**
* If true, the asset symbol will be hidden.
* If true, the asset symbol will be visible.
*/
hideSymbol?: boolean;
showSymbol?: boolean;
/**
* If true, the displayed amount will be shortened.
*/
Expand All @@ -60,7 +60,7 @@ export const ValueViewComponent = <SelectedContext extends Context = 'default'>(
valueView,
context,
priority = 'primary',
hideSymbol = false,
showSymbol = true,
abbreviate = false,
showValue = true,
}: ValueViewComponentProps<SelectedContext>) => {
Expand All @@ -72,12 +72,8 @@ export const ValueViewComponent = <SelectedContext extends Context = 'default'>(

let formattedAmount: string | undefined;
if (showValue) {
if (abbreviate) {
const amount = getFormattedAmtFromValueView(valueView, false);
formattedAmount = shortify(Number(amount));
} else {
formattedAmount = getFormattedAmtFromValueView(valueView, true);
}
const amount = getFormattedAmtFromValueView(valueView, !abbreviate);
formattedAmount = abbreviate ? shortify(Number(amount)) : amount;
}

const metadata = getMetadata.optional(valueView);
Expand Down Expand Up @@ -121,7 +117,7 @@ export const ValueViewComponent = <SelectedContext extends Context = 'default'>(
<ValueText density={density}>{formattedAmount}</ValueText>
</div>
)}
{!hideSymbol && (
{showSymbol && (
<div className='shrink grow truncate' title={symbol}>
<ValueText density={density}>{symbol}</ValueText>
</div>
Expand Down

0 comments on commit 73ffd08

Please sign in to comment.