issue #1951 - added a hardcoded snt entry under asset list - hidden behind ERC20_ENABLED flag
This commit is contained in:
parent
641cebee09
commit
8700ec77f5
1
.env
1
.env
|
@ -4,4 +4,5 @@ DEBUG_LOGS_ENABLED=1
|
||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=1
|
ETHEREUM_DEV_CLUSTER=1
|
||||||
MAINNET_NETWORKS_ENABLED=1
|
MAINNET_NETWORKS_ENABLED=1
|
||||||
|
ERC20_ENABLED=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
|
|
|
@ -4,4 +4,5 @@ DEBUG_LOGS_ENABLED=1
|
||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=1
|
ETHEREUM_DEV_CLUSTER=1
|
||||||
MAINNET_NETWORKS_ENABLED=1
|
MAINNET_NETWORKS_ENABLED=1
|
||||||
|
ERC20_ENABLED=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
|
|
|
@ -4,4 +4,5 @@ DEBUG_LOGS_ENABLED=0
|
||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=0
|
ETHEREUM_DEV_CLUSTER=0
|
||||||
MAINNET_NETWORKS_ENABLED=0
|
MAINNET_NETWORKS_ENABLED=0
|
||||||
|
ERC20_ENABLED=0
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=info
|
||||||
|
|
|
@ -88,9 +88,12 @@
|
||||||
[btn/button {:disabled? true :style (button.styles/button-bar :last) :text-style styles/main-button-text}
|
[btn/button {:disabled? true :style (button.styles/button-bar :last) :text-style styles/main-button-text}
|
||||||
(i18n/label :t/wallet-exchange)]]]])
|
(i18n/label :t/wallet-exchange)]]]])
|
||||||
|
|
||||||
|
;; TODO(goranjovic): snt is temporarily given the same logo that eth uses to minimize the changes
|
||||||
|
;; while ERC20 is mocked and hidden behind a flag.
|
||||||
(defn- token->image [id]
|
(defn- token->image [id]
|
||||||
(case id
|
(case id
|
||||||
"eth" {:source (:ethereum resources/assets) :style (styles/asset-border components.styles/color-gray-transparent-light)}))
|
"eth" {:source (:ethereum resources/assets) :style (styles/asset-border components.styles/color-gray-transparent-light)}
|
||||||
|
"snt" {:source (:ethereum resources/assets) :style (styles/asset-border components.styles/color-blue)}))
|
||||||
|
|
||||||
(defn add-asset []
|
(defn add-asset []
|
||||||
[list/touchable-item show-not-implemented!
|
[list/touchable-item show-not-implemented!
|
||||||
|
@ -131,11 +134,18 @@
|
||||||
[add-asset]))
|
[add-asset]))
|
||||||
|
|
||||||
(defn asset-section [balance prices-loading? balance-loading?]
|
(defn asset-section [balance prices-loading? balance-loading?]
|
||||||
(let [assets [{:id "eth" :currency :eth :amount balance}]]
|
(let [assets (concat [{:id "eth" :currency :eth :amount balance}]
|
||||||
|
(if config/erc20-enabled?
|
||||||
|
[{:id "snt" :currency :snt :amount 5000000000000000000000}]))]
|
||||||
[react/view {:style styles/asset-section}
|
[react/view {:style styles/asset-section}
|
||||||
[react/text {:style styles/asset-section-title} (i18n/label :t/wallet-assets)]
|
[react/text {:style styles/asset-section-title} (i18n/label :t/wallet-assets)]
|
||||||
[list/flat-list
|
[list/flat-list
|
||||||
{:data (conj assets {}) ;; Extra map triggers rendering for add-asset
|
{:data (concat assets [{}]) ;; Extra map triggers rendering for add-asset
|
||||||
|
;; TODO(goranjovic): Refactor
|
||||||
|
;; the order where new element is inserted
|
||||||
|
;; with `conj` depends on the underlying collection type.
|
||||||
|
;; whereas `concat` like here guarantees that empty element
|
||||||
|
;; will be inserted in the end.
|
||||||
:render-fn render-asset
|
:render-fn render-asset
|
||||||
:on-refresh #(rf/dispatch [:update-wallet])
|
:on-refresh #(rf/dispatch [:update-wallet])
|
||||||
:refreshing (boolean (or prices-loading? balance-loading?))}]]))
|
:refreshing (boolean (or prices-loading? balance-loading?))}]]))
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
;; TESTFAIRY_ENABLED - indefinite
|
;; TESTFAIRY_ENABLED - indefinite
|
||||||
;; STUB_STATUS_GO - indefinite
|
;; STUB_STATUS_GO - indefinite
|
||||||
;; NOTIFICATIONS_WIP_ENABLED - in 0.9.12 release, remove in develop if all goes well
|
;; NOTIFICATIONS_WIP_ENABLED - in 0.9.12 release, remove in develop if all goes well
|
||||||
|
;; ERC20_ENABLED - until idea #3 is merged, remove in develop when ready
|
||||||
|
|
||||||
(def testfairy-enabled? (enabled? (get-config :TESTFAIRY_ENABLED)))
|
(def testfairy-enabled? (enabled? (get-config :TESTFAIRY_ENABLED)))
|
||||||
(def notifications-wip-enabled? (enabled? (get-config :NOTIFICATIONS_WIP_ENABLED 0)))
|
(def notifications-wip-enabled? (enabled? (get-config :NOTIFICATIONS_WIP_ENABLED 0)))
|
||||||
(def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0)))
|
(def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0)))
|
||||||
(def mainnet-networks-enabled? (enabled? (get-config :MAINNET_NETWORKS_ENABLED 0)))
|
(def mainnet-networks-enabled? (enabled? (get-config :MAINNET_NETWORKS_ENABLED 0)))
|
||||||
|
(def erc20-enabled? (enabled? (get-config :ERC20_ENABLED 0)))
|
||||||
(def log-level
|
(def log-level
|
||||||
(-> (get-config :LOG_LEVEL "error")
|
(-> (get-config :LOG_LEVEL "error")
|
||||||
string/lower-case
|
string/lower-case
|
||||||
|
|
Loading…
Reference in New Issue