Skip to content

Commit

Permalink
Makes prettify-balance more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed Dec 8, 2023
1 parent 18a4846 commit 8b0d40b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/quo/components/wallet/account_card/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
:end {:x 1 :y 0}}])

(defn- user-account
[]
[_]
(let [pressed? (reagent/atom false)
on-press-in #(reset! pressed? true)
on-press-out #(reset! pressed? false)]
Expand Down Expand Up @@ -147,7 +147,7 @@
[gradient-overview theme customization-color])])))))

(defn- add-account-view
[]
[_]
(let [pressed? (reagent/atom false)]
(fn [{:keys [on-press customization-color theme metrics?]}]
[rn/pressable
Expand Down
7 changes: 6 additions & 1 deletion src/status_im2/contexts/wallet/common/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

(defn prettify-balance
[balance]
(str "$" (.toFixed (if (number? balance) balance 0) 2)))
(let [valid-balance? (and balance
(or (number? balance) (.-toFixed balance)))]
(as-> balance $
(if valid-balance? $ 0)
(.toFixed $ 2)
(str "$" $))))

(defn get-derivation-path
[number-of-accounts]
Expand Down

0 comments on commit 8b0d40b

Please sign in to comment.