[#5798] change balance tilde color, remove it when 0 balance

Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2018-09-12 19:24:15 +03:00
parent a20facd895
commit 1b40ccbe86
No known key found for this signature in database
GPG Key ID: 43D1DAF5AD39C927
3 changed files with 14 additions and 5 deletions

View File

@ -58,6 +58,9 @@
(def total-value
{:color colors/white-transparent})
(def total-balance-tilde
{:color colors/white-transparent})
(defstyle total-balance-currency
{:font-size 37
:margin-left 9

View File

@ -51,6 +51,11 @@
[react/view {:style styles/total-balance}
[react/text {:style styles/total-balance-value
:accessibility-label :total-amount-value-text}
(when (and
(not= "0" value)
(not= "..." value))
[react/text {:style styles/total-balance-tilde}
"~"])
value]
[react/text {:style styles/total-balance-currency
:accessibility-label :total-amount-currency-text}

View File

@ -65,11 +65,12 @@
(or currency-code
(-> currency :code keyword))
token->decimals)]
(-> balance-total-value
(money/with-precision 2)
str
(i18n/format-currency (:code currency) false)
(->> (str "~"))))
(if (pos? balance-total-value)
(-> balance-total-value
(money/with-precision 2)
str
(i18n/format-currency (:code currency) false))
"0"))
"...")))
(re-frame/reg-sub :prices-loading?