Skip to content

Commit

Permalink
Adapt our code for Nexus changes
Browse files Browse the repository at this point in the history
Adapt to account stats having optional fiels
  • Loading branch information
csillag committed May 29, 2024
1 parent adc5c13 commit e3a5b10
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/app/components/Account/RuntimeAccountDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,29 @@ export const RuntimeAccountDetailsView: FC<RuntimeAccountDetailsViewProps> = ({

{nativeTokens.length === 1 && (
<>
<dt>{t('account.totalReceived')}</dt>
<dd>
{t('common.valueInToken', {
...getPreciseNumberFormat(account.stats.total_received),
ticker: nativeTickerNames[0],
})}
</dd>

<dt>{t('account.totalSent')}</dt>
<dd>
{t('common.valueInToken', {
...getPreciseNumberFormat(account.stats.total_sent),
ticker: nativeTickerNames[0],
})}
</dd>
{account.stats.total_received !== undefined && (
<>
<dt>{t('account.totalReceived')}</dt>
<dd>
{t('common.valueInToken', {
...getPreciseNumberFormat(account.stats.total_received),
ticker: nativeTickerNames[0],
})}
</dd>
</>
)}

{account.stats.total_sent !== undefined && (
<>
<dt>{t('account.totalSent')}</dt>
<dd>
{t('common.valueInToken', {
...getPreciseNumberFormat(account.stats.total_sent),
ticker: nativeTickerNames[0],
})}
</dd>
</>
)}
</>
)}
</StyledDescriptionList>
Expand Down

0 comments on commit e3a5b10

Please sign in to comment.