Skip to content

Commit

Permalink
Merge pull request #1377 from kaloudis/fiat-rate-loading-indicator
Browse files Browse the repository at this point in the history
components/Amount: use LoadingIndicator component for fiat rate
  • Loading branch information
kaloudis authored Mar 16, 2023
2 parents 98a4e2d + 7c66c8c commit a17042a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/Amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { themeColor } from '../utils/ThemeUtils';
import { Spacer } from './layout/Spacer';
import { Row } from './layout/Row';
import { Body } from './text/Body';
import LoadingIndicator from './LoadingIndicator';

type Units = 'sats' | 'BTC' | 'fiat';

Expand Down Expand Up @@ -94,22 +95,30 @@ function AmountDisplay({
<Row align="flex-end">
<Body jumbo={jumboText} color={color}>
{negative ? '-' : ''}
{amount}
{amount === 'N/A' ? (
<LoadingIndicator size={20} />
) : (
amount.toString()
)}
</Body>
{space ? <TextSpace /> : <Spacer width={1} />}
<FiatSymbol />
{amount !== 'N/A' && <FiatSymbol />}
{pending ? <Pending /> : null}
</Row>
);
} else {
return (
<Row align="flex-end">
{pending ? <Pending /> : null}
<FiatSymbol />
{amount !== 'N/A' && <FiatSymbol />}
{space ? <TextSpace /> : <Spacer width={1} />}
<Body jumbo={jumboText} color={color}>
{negative ? '-' : ''}
{amount.toString()}
{amount === 'N/A' ? (
<LoadingIndicator size={20} />
) : (
amount.toString()
)}
</Body>
</Row>
);
Expand Down

0 comments on commit a17042a

Please sign in to comment.