[#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 (def total-value
{:color colors/white-transparent}) {:color colors/white-transparent})
(def total-balance-tilde
{:color colors/white-transparent})
(defstyle total-balance-currency (defstyle total-balance-currency
{:font-size 37 {:font-size 37
:margin-left 9 :margin-left 9

View File

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

View File

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