Skip to content

Commit

Permalink
Fix collectible/token icon and name
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed Feb 19, 2024
1 parent 9362d12 commit 85c8b56
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
29 changes: 17 additions & 12 deletions src/quo/components/wallet/account_permissions/view.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns quo.components.wallet.account-permissions.view
(:require [quo.components.avatars.account-avatar.view :as account-avatar]
(:require [clojure.string :as string]
[quo.components.avatars.account-avatar.view :as account-avatar]
[quo.components.dividers.divider-line.view :as divider-line]
[quo.components.icon :as icons]
[quo.components.markdown.text :as text]
Expand Down Expand Up @@ -28,17 +29,21 @@
(i18n/label :t/no-relevant-tokens)]

(let [token-length (dec (count tokens))]
(map-indexed (fn [idx {:keys [type token amount collectible-name collectible-img-src]}]
^{:key idx}
[required-tokens/view
{:container-style style/token-and-text
:type type
:amount amount
:token token
:collectible-img-src collectible-img-src
:collectible-name collectible-name
:divider? (not= token-length idx)}])
tokens)))]]))
(map-indexed
(fn [idx {:keys [type token amount collectible-name collectible-img-src token-img-src] collectible-symbol :symbol}]
^{:key idx}
[required-tokens/view
{:container-style style/token-and-text
:type type
:amount amount
:token token
:token-img-src token-img-src
:collectible-img-src collectible-img-src
:collectible-name (if (string/blank? collectible-name)
collectible-symbol
collectible-name)
:divider? (not= token-length idx)}])
tokens)))]]))

(defn- view-internal
[{:keys
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(defn enabled? [v] (= "1" v))

(goog-define INFURA_TOKEN "")
(goog-define INFURA_TOKEN "e5193fde096b4a5d92433107ee22cf75")
(goog-define POKT_TOKEN "3ef2018191814b7e1009b8d9")
(goog-define OPENSEA_API_KEY "")
(goog-define RARIBLE_MAINNET_API_KEY "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[utils.re-frame :as rf]))

(defn- balances->components-props
[balances]
[balances token-img-src]
(for [{:keys [amount decimals type name] :as balance} balances]
(cond-> balance
true
Expand All @@ -29,18 +29,30 @@

(= type constants/community-token-type-erc20)
(assoc :amount (str (money/token->unit amount decimals))
:token (:symbol balance)))))
:token (:symbol balance))

token-img-src
(assoc :token-img-src {:uri token-img-src}))))

(defn- account-item
[{:keys [color address name emoji]} _ _
{:keys [selected-addresses community-id share-all-addresses? community-color]}]
(let [balances (rf/sub [:communities/permissioned-balances-by-address community-id address])]
(let [balances (rf/sub [:communities/permissioned-balances-by-address community-id address])
symbols (keep :symbol balances)
{tokens :tokens} (rf/sub [:community/token-gated-overview community-id])
token-img-src (->> (first tokens)
(map (fn [{:keys [img-src]
:as token}]
(map #(when (= % (:symbol token))
img-src)
symbols)))
ffirst)]
[quo/account-permissions
{:account {:name name
:address address
:emoji emoji
:customization-color color}
:token-details (balances->components-props balances)
:token-details (balances->components-props balances token-img-src)
:checked? (contains? selected-addresses address)
:disabled? share-all-addresses?
:on-change #(rf/dispatch [:communities/toggle-selected-permission-address
Expand Down

0 comments on commit 85c8b56

Please sign in to comment.