From 9669a4d1216b7d22107580daf3e2bff464eb2ade Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 6 Jul 2018 14:09:36 -0700 Subject: Create Balance component and make token symbols smaller than token amounts --- packages/website/ts/components/ui/balance.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/website/ts/components/ui/balance.tsx (limited to 'packages/website/ts/components/ui/balance.tsx') diff --git a/packages/website/ts/components/ui/balance.tsx b/packages/website/ts/components/ui/balance.tsx new file mode 100644 index 000000000..9e5a256b6 --- /dev/null +++ b/packages/website/ts/components/ui/balance.tsx @@ -0,0 +1,27 @@ +import { BigNumber } from '@0xproject/utils'; +import * as React from 'react'; +import { Container } from 'ts/components/ui/container'; +import { Text } from 'ts/components/ui/text'; +import { utils } from 'ts/utils/utils'; + +export interface BalanceProps { + amount: BigNumber; + decimals: number; + symbol: string; +} + +export const Balance: React.StatelessComponent = ({ amount, decimals, symbol }) => { + const formattedAmout = utils.getFormattedAmount(amount, decimals); + return ( + + + {formattedAmout} + + + + {symbol} + + + + ); +}; -- cgit