Sort Assets in alphabetical order on Wallet -> Manage Assets screen #3926
This commit is contained in:
parent
0d0be37904
commit
b18d6b06c7
|
@ -33,6 +33,6 @@
|
||||||
[toolbar/content-title {:color :white}
|
[toolbar/content-title {:color :white}
|
||||||
(i18n/label :t/wallet-assets)]]
|
(i18n/label :t/wallet-assets)]]
|
||||||
[react/view {:style components.styles/flex}
|
[react/view {:style components.styles/flex}
|
||||||
[list/flat-list {:data (tokens/tokens-for (ethereum/network->chain-keyword network))
|
[list/flat-list {:data (tokens/sorted-tokens-for (ethereum/network->chain-keyword network))
|
||||||
:key-fn (comp str :symbol)
|
:key-fn (comp str :symbol)
|
||||||
:render-fn #(render-token % visible-tokens)}]]]))
|
:render-fn #(render-token % visible-tokens)}]]]))
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
(ns status-im.utils.ethereum.tokens
|
(ns status-im.utils.ethereum.tokens
|
||||||
(:require-macros [status-im.utils.ethereum.macros :refer [resolve-icons]]))
|
(:require-macros [status-im.utils.ethereum.macros :refer [resolve-icons]])
|
||||||
|
(:require [clojure.string :as string]))
|
||||||
|
|
||||||
(defn- asset-border [color]
|
(defn- asset-border [color]
|
||||||
{:border-color color :border-width 1 :border-radius 32})
|
{:border-color color :border-width 1 :border-radius 32})
|
||||||
|
@ -407,6 +408,11 @@
|
||||||
(defn tokens-for [chain]
|
(defn tokens-for [chain]
|
||||||
(get all chain))
|
(get all chain))
|
||||||
|
|
||||||
|
(defn sorted-tokens-for [chain]
|
||||||
|
(->> (tokens-for chain)
|
||||||
|
(sort #(compare (string/lower-case (:name %1))
|
||||||
|
(string/lower-case (:name %2))))))
|
||||||
|
|
||||||
(defn symbol->token [chain symbol]
|
(defn symbol->token [chain symbol]
|
||||||
(some #(when (= symbol (:symbol %)) %) (tokens-for chain)))
|
(some #(when (= symbol (:symbol %)) %) (tokens-for chain)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue