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

fix: fee tier market share percentage should show 1 decimal #842

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
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
14 changes: 12 additions & 2 deletions src/pages/portfolio/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { getFeeTiers } from '@/state/configsSelectors';

import { isTruthy } from '@/lib/isTruthy';

const MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we move this to Numbers.ts?


const EQUALITY_SYMBOL_MAP = {
'>=': '≥',
'<=': '≤',
Expand Down Expand Up @@ -61,15 +63,23 @@ export const Fees = () => {
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
{stringGetter({ key: STRING_KEYS.EXCHANGE_MARKET_SHARE })}{' '}
<$Highlighted>{'>'}</$Highlighted>{' '}
<$HighlightOutput type={OutputType.Percent} value={totalShare} fractionDigits={0} />
<$HighlightOutput
type={OutputType.Percent}
value={totalShare}
fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS}
/>
</$AdditionalConditionsText>
)}
{!!makerShare && (
<$AdditionalConditionsText>
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
{stringGetter({ key: STRING_KEYS.MAKER_MARKET_SHARE })}{' '}
<$Highlighted>{'>'}</$Highlighted>{' '}
<$HighlightOutput type={OutputType.Percent} value={makerShare} fractionDigits={0} />
<$HighlightOutput
type={OutputType.Percent}
value={makerShare}
fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS}
/>
</$AdditionalConditionsText>
)}
</$AdditionalConditions>
Expand Down
Loading