aboutsummaryrefslogtreecommitdiff
path: root/src/webex/renderHtml.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-06-04 17:56:55 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-06-04 17:56:55 +0200
commitc88bcce9987d4b5cc8123002485a928ff4191e94 (patch)
treea9d11203372ff9736145c5a2900b371b96674d1d /src/webex/renderHtml.tsx
parente0e496b87837080b98caa002725768a497836c9f (diff)
downloadwallet-core-c88bcce9987d4b5cc8123002485a928ff4191e94.tar.xz
some UI fixes
Diffstat (limited to 'src/webex/renderHtml.tsx')
-rw-r--r--src/webex/renderHtml.tsx12
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}&nbsp;{amount.currency}</span>;
+}
+
+
+/**
* Abbreviate a string to a given length, and show the full
* string on hover as a tooltip.
*/