From 356204725cbc18f4138a55728722426f925488e4 Mon Sep 17 00:00:00 2001 From: Ulises M Date: Tue, 28 Nov 2023 18:50:03 -0600 Subject: [PATCH] Replace token images by new token component The new component is being used in the following components: - token-input - network-amount - token-tag - summary-tag - context-tag - token-value - token-network - preview-list --- .../components/community/token_gating.cljs | 54 +++++++++---------- .../list_items/preview_list/view.cljs | 8 ++- .../token_network/component_spec.cljs | 2 +- .../list_items/token_network/style.cljs | 4 +- .../list_items/token_network/view.cljs | 8 +-- .../list_items/token_value/view.cljs | 7 +-- .../components/tags/context_tag/style.cljs | 4 ++ src/quo/components/tags/context_tag/view.cljs | 13 +++-- .../tags/summary_tag/component_spec.cljs | 6 +-- .../components/tags/summary_tag/style.cljs | 4 +- src/quo/components/tags/summary_tag/view.cljs | 15 +++--- src/quo/components/tags/token_tag/style.cljs | 10 ++-- src/quo/components/tags/token_tag/view.cljs | 28 +++++----- .../wallet/network_amount/view.cljs | 6 +-- .../components/wallet/token_input/style.cljs | 4 -- .../components/wallet/token_input/view.cljs | 6 +-- .../transaction_summary/component_spec.cljs | 8 +-- .../quo_preview/community/token_gating.cljs | 8 --- .../drawers/permission_drawers.cljs | 8 ++- .../quo_preview/list_items/preview_lists.cljs | 7 +-- .../quo_preview/list_items/token_network.cljs | 11 ++-- .../quo_preview/settings/category.cljs | 5 +- .../quo_preview/tags/context_tags.cljs | 10 ++-- .../quo_preview/tags/summary_tag.cljs | 2 +- .../contexts/quo_preview/tags/token_tag.cljs | 9 +--- .../wallet/transaction_summary.cljs | 28 +++++----- .../quo_preview/wallet/wallet_activity.cljs | 18 +++---- .../contexts/wallet/common/temp.cljs | 15 +++--- .../wallet/send/select_asset/view.cljs | 4 +- 29 files changed, 141 insertions(+), 171 deletions(-) diff --git a/src/quo/components/community/token_gating.cljs b/src/quo/components/community/token_gating.cljs index 3cef0b0a425e..387ec5bd4199 100644 --- a/src/quo/components/community/token_gating.cljs +++ b/src/quo/components/community/token_gating.cljs @@ -10,40 +10,36 @@ (defn token-requirement-list-row [tokens padding?] - [rn/view - {:style (style/token-row padding?)} - (doall - (map-indexed (fn [token-index token] - (let [{:keys [img-src amount sufficient? purchasable?]} token] - ^{:key token-index} - [rn/view {:style style/token-tag-spacing} - [token-tag/view - {:token-symbol (:symbol token) - :token-value amount - :size :size-24 - :options (cond - sufficient? :hold - purchasable? :add) - :token-img-src img-src}]])) - tokens))]) + [rn/view {:style (style/token-row padding?)} + (map-indexed (fn [token-index token] + (let [{:keys [amount sufficient? purchasable?]} token] + ^{:key token-index} + [rn/view {:style style/token-tag-spacing} + [token-tag/view + {:token-symbol (:symbol token) + :token-value amount + :size :size-24 + :options (cond + sufficient? :hold + purchasable? :add)}]])) + tokens)]) (defn- internal-view [{:keys [tokens padding? theme]}] [:<> (if (> (count tokens) 1) - (doall - (map-indexed - (fn [token-requirement-index tokens] - ^{:key token-requirement-index} - [rn/view {:margin-bottom 12} - (when-not (= token-requirement-index 0) - [rn/view {:style (style/token-row-or-border theme)}]) - (when-not (= token-requirement-index 0) - [text/text - {:style (style/token-row-or-text padding? theme) - :size :label} (string/lower-case (i18n/label :t/or))]) - [token-requirement-list-row tokens padding?]]) - tokens)) + (map-indexed + (fn [token-requirement-index tokens] + ^{:key token-requirement-index} + [rn/view {:margin-bottom 12} + (when-not (= token-requirement-index 0) + [rn/view {:style (style/token-row-or-border theme)}]) + (when-not (= token-requirement-index 0) + [text/text + {:style (style/token-row-or-text padding? theme) + :size :label} (string/lower-case (i18n/label :t/or))]) + [token-requirement-list-row tokens padding?]]) + tokens) [token-requirement-list-row (first tokens) padding?])]) (def token-requirement-list (quo.theme/with-theme internal-view)) diff --git a/src/quo/components/list_items/preview_list/view.cljs b/src/quo/components/list_items/preview_list/view.cljs index 8666ebb8c579..6fd126bdfc9a 100644 --- a/src/quo/components/list_items/preview_list/view.cljs +++ b/src/quo/components/list_items/preview_list/view.cljs @@ -4,6 +4,7 @@ [quo.components.avatars.user-avatar.view :as user-avatar] [quo.components.list-items.preview-list.properties :as properties] [quo.components.tags.number-tag.view :as number-tag] + [quo.components.token :as token] [quo.theme :as quo.theme] [react-native.core :as rn] [react-native.fast-image :as fast-image] @@ -31,7 +32,12 @@ :height size :border-radius border-radius}}] - (:tokens :network :dapps) [fast-image/fast-image + :tokens [token/view + {:token item + :size size + :style {:border-radius border-radius}}] + + (:network :dapps) [fast-image/fast-image {:source (or (:source item) item) :style {:width size :height size diff --git a/src/quo/components/list_items/token_network/component_spec.cljs b/src/quo/components/list_items/token_network/component_spec.cljs index 07cc55ea31a4..e43a8cd046a4 100644 --- a/src/quo/components/list_items/token_network/component_spec.cljs +++ b/src/quo/components/list_items/token_network/component_spec.cljs @@ -5,7 +5,7 @@ [test-helpers.component :as h])) (def props - {:token (resources/get-token :snt) + {:token :snt :state :default :label "Status" :networks [(resources/get-network :ethereum)] diff --git a/src/quo/components/list_items/token_network/style.cljs b/src/quo/components/list_items/token_network/style.cljs index 721858609adb..0ce4ec51f62c 100644 --- a/src/quo/components/list_items/token_network/style.cljs +++ b/src/quo/components/list_items/token_network/style.cljs @@ -34,9 +34,7 @@ :flex 1}) (def token-image - {:width 32 - :height 32 - :border-width 1 + {:border-width 1 :border-radius 16 :border-color colors/neutral-80-opa-5 :margin-right 8 diff --git a/src/quo/components/list_items/token_network/view.cljs b/src/quo/components/list_items/token_network/view.cljs index b2b6c4f62f57..8ebe4d6f5c4a 100644 --- a/src/quo/components/list_items/token_network/view.cljs +++ b/src/quo/components/list_items/token_network/view.cljs @@ -4,6 +4,7 @@ [quo.components.list-items.preview-list.view :as preview-list] [quo.components.list-items.token-network.style :as style] [quo.components.markdown.text :as text] + [quo.components.token :as token] [quo.theme :as quo.theme] [react-native.core :as rn] [reagent.core :as reagent])) @@ -11,9 +12,10 @@ (defn- info [{:keys [token label networks]}] [rn/view {:style style/info} - [rn/image - {:source (or (:source token) token) - :style style/token-image}] + [token/view + {:style style/token-image + :size :size-32 + :token token}] [rn/view {:style style/token-info} [text/text {:weight :semi-bold diff --git a/src/quo/components/list_items/token_value/view.cljs b/src/quo/components/list_items/token_value/view.cljs index bbc639807bb8..4d308c841632 100644 --- a/src/quo/components/list_items/token_value/view.cljs +++ b/src/quo/components/list_items/token_value/view.cljs @@ -4,9 +4,9 @@ [quo.components.icon :as icon] [quo.components.list-items.token-value.style :as style] [quo.components.markdown.text :as text] + [quo.components.token :as token] [quo.foundations.colors :as colors] [quo.foundations.common :as common] - [quo.foundations.resources :as resources] [quo.theme :as quo.theme] [react-native.core :as rn] [reagent.core :as reagent])) @@ -34,10 +34,7 @@ {:style {:flex-direction :row :align-items :center :flex 1}} - [rn/image - {:source (resources/get-token token) - :style {:width 32 - :height 32}}] + [token/view {:token token :size :size-32}] [rn/view {:style {:margin-left 8}} [text/text {:weight :semi-bold} (common/token-label token)] [text/text diff --git a/src/quo/components/tags/context_tag/style.cljs b/src/quo/components/tags/context_tag/style.cljs index 9abc907937c3..4fddec851fb6 100644 --- a/src/quo/components/tags/context_tag/style.cljs +++ b/src/quo/components/tags/context_tag/style.cljs @@ -59,6 +59,10 @@ [theme] {:color (colors/theme-colors colors/neutral-100 colors/white theme)}) +(defn token-logo + [size] + {:border-radius (if (= size 24) 10 14)}) + (defn circle-logo [size] (if (= size 24) diff --git a/src/quo/components/tags/context_tag/view.cljs b/src/quo/components/tags/context_tag/view.cljs index 568b67560da1..6311a5d3850e 100644 --- a/src/quo/components/tags/context_tag/view.cljs +++ b/src/quo/components/tags/context_tag/view.cljs @@ -7,6 +7,7 @@ [quo.components.list-items.preview-list.view :as preview-list] [quo.components.markdown.text :as text] [quo.components.tags.context-tag.style :as style] + [quo.components.token :as token] [quo.foundations.colors :as colors] [quo.theme :as quo.theme] [react-native.core :as rn])) @@ -73,7 +74,7 @@ (defn- view-internal [{:keys [theme type size state blur? customization-color profile-picture full-name users - group-name token-logo amount token-name network-logo network-name networks + group-name amount token network-logo network-name networks account-name emoji collectible collectible-name collectible-number duration container-style] :or {customization-color :blue type :default @@ -123,8 +124,11 @@ [communities-tag (assoc props :channel? (= type :channel))] :token - [tag-skeleton {:theme theme :size size :text (str amount " " token-name)} - [rn/image {:style (style/circle-logo size) :source token-logo}]] + [tag-skeleton {:theme theme :size size :text (str amount " " token)} + [token/view + {:style (style/token-logo size) + :token token + :size (if (= size 24) :size-20 :size-28)}]] :network [tag-skeleton {:theme theme :size size :text network-name} @@ -182,9 +186,8 @@ - `:token` - size - - token-logo (valid rn/image :source value) - amount - - token-name + - token - `:network` - size diff --git a/src/quo/components/tags/summary_tag/component_spec.cljs b/src/quo/components/tags/summary_tag/component_spec.cljs index c996995b610a..e3217dda640f 100644 --- a/src/quo/components/tags/summary_tag/component_spec.cljs +++ b/src/quo/components/tags/summary_tag/component_spec.cljs @@ -47,7 +47,7 @@ (h/test "Token view render" (h/render [summary-tag/view - {:type :token - :label "1,000 SNT" - :image-source "path/to/token-image.png"}]) + {:type :token + :label "1,000 SNT" + :token :eth}]) (h/is-truthy (h/get-by-text "1,000 SNT")))) diff --git a/src/quo/components/tags/summary_tag/style.cljs b/src/quo/components/tags/summary_tag/style.cljs index f495ed4c5aa3..e36da3d2d515 100644 --- a/src/quo/components/tags/summary_tag/style.cljs +++ b/src/quo/components/tags/summary_tag/style.cljs @@ -24,6 +24,4 @@ :border-radius 10}) (def token-image - {:width 24 - :height 24 - :border-radius 12}) + {:border-radius 12}) diff --git a/src/quo/components/tags/summary_tag/view.cljs b/src/quo/components/tags/summary_tag/view.cljs index 62d08bfd6f10..44f7dbbcd5f6 100644 --- a/src/quo/components/tags/summary_tag/view.cljs +++ b/src/quo/components/tags/summary_tag/view.cljs @@ -5,12 +5,13 @@ [quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar] [quo.components.markdown.text :as text] [quo.components.tags.summary-tag.style :as style] + [quo.components.token :as token] [quo.foundations.colors :as colors] [quo.theme :as quo.theme] [react-native.core :as rn])) (defn- left-view - [{:keys [label type customization-color emoji image-source]}] + [{:keys [label type customization-color emoji image-source token]}] (case type :account [account-avatar/view @@ -38,9 +39,10 @@ :profile-picture image-source :customization-color customization-color}] :token - [rn/image - {:source image-source - :style style/token-image}] + [token/view + {:token token + :size :size-24 + :style style/token-image}] nil)) (defn- view-internal @@ -50,7 +52,7 @@ should vary based on a custom color. - :type - :token / :user / :collectible / :saved-address / :network / :account - :emoji - string - emoji used for displaying account avatar - - :image-source - resource - image to display on :network, :collectible :user and :token + - :image-source - resource - image to display on :network, :collectible and :user - :theme - :light / :dark" [{:keys [label customization-color type theme] :as props @@ -62,6 +64,7 @@ [text/text {:style (style/label type theme) :weight :semi-bold - :size :heading-1} label]]) + :size :heading-1} + label]]) (def view (quo.theme/with-theme view-internal)) diff --git a/src/quo/components/tags/token_tag/style.cljs b/src/quo/components/tags/token_tag/style.cljs index fc16fa0eb569..57c6a7501f34 100644 --- a/src/quo/components/tags/token_tag/style.cljs +++ b/src/quo/components/tags/token_tag/style.cljs @@ -34,14 +34,10 @@ (defn token-img [size] - (condp = size - :size-24 {:width 20 - :height 20 - :margin-right 6 + (case size + :size-24 {:margin-right 6 :border-radius 10} - :size-32 {:width 28 - :height 28 - :margin-right 8 + :size-32 {:margin-right 8 :border-radius 14})) (defn label diff --git a/src/quo/components/tags/token_tag/view.cljs b/src/quo/components/tags/token_tag/view.cljs index 31fa22b9d3ee..38660f6d75d1 100644 --- a/src/quo/components/tags/token_tag/view.cljs +++ b/src/quo/components/tags/token_tag/view.cljs @@ -4,6 +4,7 @@ [quo.components.icon :as icons] [quo.components.markdown.text :as text] [quo.components.tags.token-tag.style :as style] + [quo.components.token :as token] [quo.theme :as quo.theme] [react-native.core :as rn] [react-native.hole-view :as hole-view] @@ -14,13 +15,12 @@ - :options - false / :add / :hold (default false) - :size - :size-24 / :size-32 (default :size-24) - :blur? - boolean (default false) - - :theme - :light / :dark - - :token-img-src - token image source + - :theme - :light / :dark - :token-value - string - token value - :token-symbol - string" [] (let [container-width (reagent/atom 0)] - (fn [{:keys [options size blur? theme token-img-src token-value token-symbol] + (fn [{:keys [options size blur? theme token-value token-symbol] :or {size :size-24}}] [rn/view {:on-layout #(reset! container-width @@ -28,21 +28,25 @@ [hole-view/hole-view {:holes (if options [{:x (- @container-width - (condp = size + (case size :size-24 10 - :size-32 12)) - :y (condp = size + :size-32 12 + nil)) + :y (case size :size-24 -6 - :size-32 -4) + :size-32 -4 + nil) :width 16 :height 16 :borderRadius 8}] [])} - [rn/view - {:style (style/container size options blur? theme)} - [rn/image - {:style (style/token-img size) - :source token-img-src}] + [rn/view {:style (style/container size options blur? theme)} + [token/view + {:style (style/token-img size) + :token token-symbol + :size (case size + :size-24 :size-20 + :size-32 :size-28)}] [text/text {:size :paragraph-2 :weight :medium diff --git a/src/quo/components/wallet/network_amount/view.cljs b/src/quo/components/wallet/network_amount/view.cljs index 3d5086926a01..3d6d2020e2f6 100644 --- a/src/quo/components/wallet/network_amount/view.cljs +++ b/src/quo/components/wallet/network_amount/view.cljs @@ -2,17 +2,15 @@ (:require [clojure.string :as string] [quo.components.markdown.text :as text] + [quo.components.token :as token] [quo.components.wallet.network-amount.style :as style] - [quo.foundations.resources :as resources] [quo.theme :as quo.theme] [react-native.core :as rn])) (defn- view-internal [{:keys [amount token theme]}] [rn/view {:style style/container} - [rn/image - {:source (resources/get-token token) - :style {:width 12 :height 12}}] + [token/view {:token token :size :size-12}] [text/text {:weight :medium :size :paragraph-2 diff --git a/src/quo/components/wallet/token_input/style.cljs b/src/quo/components/wallet/token_input/style.cljs index ab261689f413..ab8773fbc91a 100644 --- a/src/quo/components/wallet/token_input/style.cljs +++ b/src/quo/components/wallet/token_input/style.cljs @@ -16,10 +16,6 @@ :flex-direction :row :justify-content :space-between}) -(def token - {:width 32 - :height 32}) - (defn text-input [theme] (merge typography/heading-1 diff --git a/src/quo/components/wallet/token_input/view.cljs b/src/quo/components/wallet/token_input/view.cljs index c15156fa0c71..b057073ab76b 100644 --- a/src/quo/components/wallet/token_input/view.cljs +++ b/src/quo/components/wallet/token_input/view.cljs @@ -5,10 +5,10 @@ [quo.components.dividers.divider-line.view :as divider-line] [quo.components.markdown.text :as text] [quo.components.tags.network-tags.view :as network-tag] + [quo.components.token :as token] [quo.components.wallet.token-input.style :as style] [quo.foundations.colors :as colors] [quo.foundations.common :as common] - [quo.foundations.resources :as resources] [quo.theme :as quo.theme] [react-native.core :as rn] [reagent.core :as reagent])) @@ -33,9 +33,7 @@ :style {:flex-direction :row :flex-grow 1 :align-items :flex-end}} - [rn/image - {:style style/token - :source (resources/get-token token)}] + [token/view {:token token :size :size-32}] [rn/text-input {:ref #(reset! input-ref %) :placeholder "0" diff --git a/src/quo/components/wallet/transaction_summary/component_spec.cljs b/src/quo/components/wallet/transaction_summary/component_spec.cljs index 99d60c4050b2..30a6585e7f6b 100644 --- a/src/quo/components/wallet/transaction_summary/component_spec.cljs +++ b/src/quo/components/wallet/transaction_summary/component_spec.cljs @@ -19,10 +19,10 @@ (h/test "Context tag rendered" (h/render [transaction-summary/view {:transaction :send - :first-tag {:size 24 - :type :token - :token-name "SNT" - :amount 1500}}]) + :first-tag {:size 24 + :type :token + :token "SNT" + :amount 1500}}]) (h/is-truthy (h/query-by-label-text :context-tag)))) diff --git a/src/status_im2/contexts/quo_preview/community/token_gating.cljs b/src/status_im2/contexts/quo_preview/community/token_gating.cljs index f150b3e696ae..43848f9f6839 100644 --- a/src/status_im2/contexts/quo_preview/community/token_gating.cljs +++ b/src/status_im2/contexts/quo_preview/community/token_gating.cljs @@ -1,7 +1,6 @@ (ns status-im2.contexts.quo-preview.community.token-gating (:require [quo.core :as quo] - [quo.foundations.resources :as resources] [reagent.core :as reagent] [status-im2.contexts.quo-preview.preview :as preview])) @@ -22,29 +21,24 @@ [sufficient? many-tokens? loading?] (into [{:symbol "KNC" - :img-src (resources/get-token :knc) :amount 200 :sufficient? true :loading? loading?} {:symbol "MANA" - :img-src (resources/get-token :mana) :amount 10 :sufficient? sufficient? :purchasable? true :loading? loading?} {:symbol "RARE" - :img-src (resources/get-token :rare) :amount 10 :sufficient? sufficient? :loading? loading?}] (when many-tokens? [{:symbol "FXC" - :img-src (resources/get-token :fxc) :amount 20 :sufficient? true :loading? loading?} {:symbol "SNT" - :img-src (resources/get-token :snt) :amount 10000 :sufficient? sufficient? :loading? loading?}]))) @@ -58,11 +52,9 @@ many-tokens? loading?) [{:symbol "FXC" - :img-src (resources/get-token :fxc) :amount 20 :sufficient? true} {:symbol "USDT" - :img-src (resources/get-token :usdt) :amount 20 :sufficient? false}]] [(join-gate-options-base sufficient? diff --git a/src/status_im2/contexts/quo_preview/drawers/permission_drawers.cljs b/src/status_im2/contexts/quo_preview/drawers/permission_drawers.cljs index edd8b8ca70dc..b7c36c768388 100644 --- a/src/status_im2/contexts/quo_preview/drawers/permission_drawers.cljs +++ b/src/status_im2/contexts/quo_preview/drawers/permission_drawers.cljs @@ -2,7 +2,6 @@ (:require [quo.core :as quo] [quo.foundations.colors :as colors] - [quo.foundations.resources :as quo.resources] [react-native.core :as rn] [status-im2.common.resources :as resources])) @@ -42,10 +41,9 @@ [:<> [quo/text {:style {:margin-right 4}} "Hold"] [quo/token-tag - {:size :size-24 - :token-img-src (quo.resources/get-token :eth) - :token-value 5 - :token-symbol "ETH"}] + {:size :size-24 + :token-value 5 + :token-symbol "ETH"}] [quo/text {:style {:margin-left 4}} "To post"]]) (defn example-3 diff --git a/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs b/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs index 111ebd43a6cc..0e7badf2252d 100644 --- a/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs +++ b/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs @@ -66,12 +66,7 @@ :emoji "🍓" :type :default}]) -(def tokens-list - [{:source (quo.resources/get-token :snt)} - {:source (quo.resources/get-token :eth)} - {:source (quo.resources/get-token :knc)} - {:source (quo.resources/get-token :mana)} - {:source (quo.resources/get-token :rare)}]) +(def tokens-list [:snt :eth :knc :mana :rare]) (def communities-list [{:source (resources/get-mock-image :coinbase)} diff --git a/src/status_im2/contexts/quo_preview/list_items/token_network.cljs b/src/status_im2/contexts/quo_preview/list_items/token_network.cljs index 531a5a0c58cb..6163c6c3cd29 100644 --- a/src/status_im2/contexts/quo_preview/list_items/token_network.cljs +++ b/src/status_im2/contexts/quo_preview/list_items/token_network.cljs @@ -20,12 +20,9 @@ {:key :selected}]} {:key :token :type :select - :options [{:value :eth - :key (quo.resources/get-token :eth)} - {:value :snt - :key (quo.resources/get-token :snt)} - {:value :dai - :key (quo.resources/get-token :dai)}]} + :options [{:key :eth} + {:key :snt} + {:key :dai}]} {:key :label :type :text} {:key :token-value @@ -38,7 +35,7 @@ (defn view [] - (let [state (reagent/atom {:token (quo.resources/get-token :snt) + (let [state (reagent/atom {:token :snt :label "Status" :token-value "0.00 SNT" :fiat-value "€0.00" diff --git a/src/status_im2/contexts/quo_preview/settings/category.cljs b/src/status_im2/contexts/quo_preview/settings/category.cljs index c93e4969d29b..6ce1dc526777 100644 --- a/src/status_im2/contexts/quo_preview/settings/category.cljs +++ b/src/status_im2/contexts/quo_preview/settings/category.cljs @@ -21,7 +21,10 @@ [{:key :blur? :type :boolean} {:key :list-type :type :select - :options [{:key :settings :value :settings} {:key :reorder :value :reorder}]}]) + :options [{:key :settings + :value :settings} + {:key :reorder + :value :reorder}]}]) (defn view [] diff --git a/src/status_im2/contexts/quo_preview/tags/context_tags.cljs b/src/status_im2/contexts/quo_preview/tags/context_tags.cljs index 14023f1191fb..a8b1bd35ccd5 100644 --- a/src/status_im2/contexts/quo_preview/tags/context_tags.cljs +++ b/src/status_im2/contexts/quo_preview/tags/context_tags.cljs @@ -97,8 +97,11 @@ [size-descriptor {:key :amount :type :text} - {:key :token-name - :type :text}]) + {:key :token + :type :select + :options [{:key "ETH"} + {:key "SNT"} + {:key "DAI"}]}]) (def network-descriptor [size-descriptor @@ -202,8 +205,7 @@ :community-logo (resources/mock-images :coinbase) :community-name "Community" :channel-name "my channel" - :token-logo (resources/mock-images :diamond) - :token-name "ETH" + :token "ETH" :amount "10" :network-logo (resources/mock-images :monkey) :network-name "Network" diff --git a/src/status_im2/contexts/quo_preview/tags/summary_tag.cljs b/src/status_im2/contexts/quo_preview/tags/summary_tag.cljs index 7b897498fa50..cd52b315a961 100644 --- a/src/status_im2/contexts/quo_preview/tags/summary_tag.cljs +++ b/src/status_im2/contexts/quo_preview/tags/summary_tag.cljs @@ -13,7 +13,7 @@ :token {:customization-color "#9999991A" :label "150 ETH" - :image-source (quo.resources/get-token :eth)} + :token :eth} :address {:label "0x39c...Bd2"} :user diff --git a/src/status_im2/contexts/quo_preview/tags/token_tag.cljs b/src/status_im2/contexts/quo_preview/tags/token_tag.cljs index 61f550aaa134..805ffbfd35fa 100644 --- a/src/status_im2/contexts/quo_preview/tags/token_tag.cljs +++ b/src/status_im2/contexts/quo_preview/tags/token_tag.cljs @@ -1,7 +1,6 @@ (ns status-im2.contexts.quo-preview.tags.token-tag (:require [quo.core :as quo] - [quo.foundations.resources :as resources] [react-native.core :as rn] [reagent.core :as reagent] [status-im2.contexts.quo-preview.preview :as preview])) @@ -42,9 +41,6 @@ {:key "SNT" :value "SNT"}]}]) -(def eth-token (resources/get-token :eth)) -(def snt-token (resources/get-token :snt)) - (defn view [] (let [state (reagent/atom {:size :size-24 @@ -59,7 +55,4 @@ :show-blur-background? true :descriptor descriptor} [rn/view {:style {:align-items :center}} - [quo/token-tag - (assoc @state - :token-img-src - (if (= (get-in @state [:token-symbol]) "ETH") eth-token snt-token))]]]))) + [quo/token-tag @state]]]))) diff --git a/src/status_im2/contexts/quo_preview/wallet/transaction_summary.cljs b/src/status_im2/contexts/quo_preview/wallet/transaction_summary.cljs index 62f5d3e40121..f82f256ed1c0 100644 --- a/src/status_im2/contexts/quo_preview/wallet/transaction_summary.cljs +++ b/src/status_im2/contexts/quo_preview/wallet/transaction_summary.cljs @@ -7,25 +7,22 @@ [status-im2.contexts.quo-preview.preview :as preview])) (def asset-snt - {:size 24 - :type :token - :token-name "SNT" - :amount 1500 - :token-logo (quo.resources/get-token :snt)}) + {:size 24 + :type :token + :token "SNT" + :amount 1500}) (def asset-eth - {:size 24 - :type :token - :token-name "ETH" - :amount 75 - :token-logo (quo.resources/get-token :eth)}) + {:size 24 + :type :token + :token "ETH" + :amount 75}) (def asset-dai - {:size 24 - :type :token - :token-name "DAI" - :amount 2400 - :token-logo (quo.resources/get-token :dai)}) + {:size 24 + :type :token + :token "DAI" + :amount 2400}) (def asset-collectible {:size 24 @@ -157,7 +154,6 @@ :value "At"}]) (def descriptor - (concat [{:key :transaction :type :select diff --git a/src/status_im2/contexts/quo_preview/wallet/wallet_activity.cljs b/src/status_im2/contexts/quo_preview/wallet/wallet_activity.cljs index 0fb4e20f34c6..15bcfef6f637 100644 --- a/src/status_im2/contexts/quo_preview/wallet/wallet_activity.cljs +++ b/src/status_im2/contexts/quo_preview/wallet/wallet_activity.cljs @@ -8,18 +8,16 @@ [status-im2.contexts.quo-preview.preview :as preview])) (def asset-snt - {:size 24 - :type :token - :token-name "SNT" - :amount 1500 - :token-logo (quo.resources/get-token :snt)}) + {:size 24 + :type :token + :token "SNT" + :amount 1500}) (def asset-dai - {:size 24 - :type :token - :token-name "DAI" - :amount 2400 - :token-logo (quo.resources/get-token :dai)}) + {:size 24 + :type :token + :token "DAI" + :amount 2400}) (def asset-collectible {:size 24 diff --git a/src/status_im2/contexts/wallet/common/temp.cljs b/src/status_im2/contexts/wallet/common/temp.cljs index 864ed462e548..02749686e239 100644 --- a/src/status_im2/contexts/wallet/common/temp.cljs +++ b/src/status_im2/contexts/wallet/common/temp.cljs @@ -113,11 +113,10 @@ :networks [{:network-name :ethereum :short-name "eth"}]}]) (def asset-snt - {:size 24 - :type :token - :token-name "SNT" - :amount 1500 - :token-logo (quo.resources/get-token :snt)}) + {:size 24 + :type :token + :token "SNT" + :amount 1500}) (def piggy-bank {:size 24 @@ -211,21 +210,21 @@ (defn bridge-token-list [networks-list] - [{:token (quo.resources/get-token :snt) + [{:token :snt :label "Status" :token-value "0.00 SNT" :fiat-value "€0.00" :networks networks-list :state :default :customization-color :blue} - {:token (quo.resources/get-token :eth) + {:token :eth :label "Ethereum" :token-value "0.00 ETH" :fiat-value "€0.00" :networks networks-list :state :default :customization-color :blue} - {:token (quo.resources/get-token :dai) + {:token :dai :label "Dai" :token-value "0.00 DAI" :fiat-value "€0.00" diff --git a/src/status_im2/contexts/wallet/send/select_asset/view.cljs b/src/status_im2/contexts/wallet/send/select_asset/view.cljs index 984dda3338e1..de2d3e014fa4 100644 --- a/src/status_im2/contexts/wallet/send/select_asset/view.cljs +++ b/src/status_im2/contexts/wallet/send/select_asset/view.cljs @@ -1,8 +1,6 @@ (ns status-im2.contexts.wallet.send.select-asset.view (:require - [clojure.string :as string] [quo.core :as quo] - [quo.foundations.resources :as quo.resources] [quo.theme :as quo.theme] [react-native.core :as rn] [react-native.safe-area :as safe-area] @@ -23,7 +21,7 @@ balance-fiat-formatted (.toFixed (:total-balance-fiat token) 2) currency-symbol "$"] [quo/token-network - {:token (quo.resources/get-token (keyword (string/lower-case (:symbol token)))) + {:token (:symbol token) :label (:name token) :token-value (str total-balance-formatted " " (:symbol token)) :fiat-value (str currency-symbol balance-fiat-formatted)