diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-06-04 17:56:55 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-06-04 17:56:55 +0200 |
commit | c88bcce9987d4b5cc8123002485a928ff4191e94 (patch) | |
tree | a9d11203372ff9736145c5a2900b371b96674d1d /src/webex/renderHtml.tsx | |
parent | e0e496b87837080b98caa002725768a497836c9f (diff) | |
download | wallet-core-c88bcce9987d4b5cc8123002485a928ff4191e94.tar.xz |
some UI fixes
Diffstat (limited to 'src/webex/renderHtml.tsx')
-rw-r--r-- | src/webex/renderHtml.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/webex/renderHtml.tsx b/src/webex/renderHtml.tsx index 4dd7baded..51f9019ef 100644 --- a/src/webex/renderHtml.tsx +++ b/src/webex/renderHtml.tsx @@ -27,6 +27,8 @@ import { amountToPretty } from "../helpers"; import * as i18n from "../i18n"; import { + AmountJson, + Amounts, ContractTerms, } from "../types"; @@ -63,6 +65,16 @@ export function renderContractTerms(contractTerms: ContractTerms): JSX.Element { /** + * Render amount as HTML, which non-breaking space between + * decimal value and currency. + */ +export function renderAmount(amount: AmountJson) { + const x = amount.value + amount.fraction / Amounts.fractionalBase; + return <span>{x} {amount.currency}</span>; +} + + +/** * Abbreviate a string to a given length, and show the full * string on hover as a tooltip. */ |