Skip to content

Commit

Permalink
Merge branch 'develop' into 17576
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Nov 28, 2023
2 parents f81d6b7 + f124ca4 commit 23e93ba
Show file tree
Hide file tree
Showing 33 changed files with 592 additions and 185 deletions.
Binary file modified resources/images/icons2/20x20/opensea@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/icons2/20x20/opensea@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/tokens/mainnet/AGLD@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/tokens/mainnet/AGLD@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/tokens/mainnet/CRV@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/tokens/mainnet/CRV@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/mocks/js_dependencies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
:Text {}
:StatusBar {}
:ScrollView {}
:SafeAreaView {}
:KeyboardAvoidingView {}
:TextInput {}
:Image {}
Expand Down
26 changes: 15 additions & 11 deletions src/quo/components/avatars/wallet_user_avatar/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@
(:require [quo.foundations.colors :as colors]))

(defn- circle-color
[customization-color]
(colors/custom-color customization-color 50 20))
[customization-color neutral? theme]
(if neutral?
(colors/theme-colors colors/neutral-80-opa-5 colors/white-opa-5 theme)
(colors/custom-color customization-color 50 20)))

(defn- text-color
[customization-color theme]
(colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme))
[customization-color neutral? theme]
(if neutral?
(colors/theme-colors colors/neutral-80-opa-70 colors/white-opa-70 theme)
(colors/theme-colors
(colors/custom-color customization-color 50)
(colors/custom-color customization-color 60)
theme)))

(defn container
[circle-size customization-color]
[circle-size customization-color neutral? theme]
{:width circle-size
:height circle-size
:border-radius circle-size
:text-align :center
:justify-content :center
:align-items :center
:background-color (circle-color customization-color)})
:background-color (circle-color customization-color neutral? theme)})

(defn text
[customization-color theme]
{:color (text-color customization-color theme)})
[customization-color neutral? theme]
{:color (text-color customization-color neutral? theme)})
18 changes: 11 additions & 7 deletions src/quo/components/avatars/wallet_user_avatar/view.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns quo.components.avatars.wallet-user-avatar.view
(:require [quo.components.avatars.wallet-user-avatar.style :as style]
(:require [clojure.string :as string]
[quo.components.avatars.wallet-user-avatar.style :as style]
[quo.components.markdown.text :as text]
[quo.theme :as quo.theme]
[react-native.core :as rn]
Expand Down Expand Up @@ -40,18 +41,21 @@
:customization-color - keyword (default: nil) - color of the avatar
:size - keyword (default: last element of properties object) - size of the
avatar
:monospace? - boolean (default: false) - use monospace font"
[{:keys [full-name customization-color size theme monospace?]
:monospace? - boolean (default: false) - use monospace font
:lowercase? - boolean (default: false) - lowercase text
:neutral? - boolean (default: false) - use neutral colors variant"
[{:keys [full-name customization-color size theme monospace? lowercase? neutral?]
:or {size biggest-possible}}]
(let [circle-size (:size (size properties))
small? (check-if-size-small size)]
small? (check-if-size-small size)
initials (utils.string/get-initials full-name (if small? 1 2))]
[rn/view
{:style (style/container circle-size customization-color)}
{:style (style/container circle-size customization-color neutral? theme)}
[text/text
{:accessibility-label :wallet-user-avatar
:size (:font-size (size properties))
:weight (if monospace? :monospace (:font-weight (size properties)))
:style (style/text customization-color theme)}
(utils.string/get-initials full-name (if small? 1 2))]]))
:style (style/text customization-color neutral? theme)}
(if lowercase? (string/lower-case initials) initials)]]))

(def wallet-user-avatar (quo.theme/with-theme view-internal))
12 changes: 6 additions & 6 deletions src/quo/components/list_items/address/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
[{:keys [theme address networks blur?]}]
[rn/view {:style style/left-container}
[wallet-user-avatar/wallet-user-avatar
{:size :medium
:f-name "0"
:l-name "x"
{:size :size-32
:full-name "0 x"
:monospace? true
:uppercase? false}]
:lowercase? true
:neutral? true}]
[rn/view {:style style/account-container}
[text/text {:size :paragraph-1}
(map (fn [network]
^{:key (str network)}
[text/text
{:size :paragraph-1
:weight :semi-bold
:style {:color (colors/resolve-color network theme)}}
(str (subs (name network) 0 3) ":")])
:style {:color (colors/resolve-color (:network-name network) theme)}}
(str (:short-name network) ":")])
networks)
[text/text
{:size :paragraph-1
Expand Down
39 changes: 17 additions & 22 deletions src/quo/components/list_items/saved_address/view.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns quo.components.list-items.saved-address.view
(:require
[clojure.string :as string]
[quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar]
[quo.components.icon :as icon]
[quo.components.list-items.saved-address.style :as style]
Expand All @@ -13,27 +12,23 @@

(defn- left-container
[{:keys [blur? theme name ens address customization-color]}]
(let [names (remove string/blank? (string/split name " "))
first-name (if (> (count names) 0) (first names) "")
last-name (if (> (count names) 1) (last names) "")]
[rn/view {:style style/left-container}
[wallet-user-avatar/wallet-user-avatar
{:size :medium
:f-name first-name
:l-name last-name
:customization-color customization-color}]
[rn/view {:style style/account-container}
[text/text
{:weight :semi-bold
:size :paragraph-1
:style style/name-text}
name]
[text/text {:size :paragraph-2}
[text/text
{:size :paragraph-2
:weight :monospace
:style (style/account-address blur? theme)}
(or ens (address/get-shortened-key address))]]]]))
[rn/view {:style style/left-container}
[wallet-user-avatar/wallet-user-avatar
{:size :size-32
:full-name name
:customization-color customization-color}]
[rn/view {:style style/account-container}
[text/text
{:weight :semi-bold
:size :paragraph-1
:style style/name-text}
name]
[text/text {:size :paragraph-2}
[text/text
{:size :paragraph-2
:weight :monospace
:style (style/account-address blur? theme)}
(or ens (address/get-shortened-key address))]]]])

(defn- internal-view
[]
Expand Down
22 changes: 13 additions & 9 deletions src/quo/components/list_items/token_network/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@

(def info
{:flex-direction :row
:align-items :center})
:align-items :center
:width "70%"})

(def token-info
{:height 40})
{:height 40
:flex 1})

(def token-image
{:width 32
:height 32
:border-width 1
:border-radius 16
:border-color colors/neutral-80-opa-5
:margin-right 8})
{:width 32
:height 32
:border-width 1
:border-radius 16
:border-color colors/neutral-80-opa-5
:margin-right 8
:background-color colors/neutral-80-opa-5})

(def values-container
{:align-items :flex-end})
{:align-items :flex-end
:max-width "30%"})

(defn fiat-value
[theme]
Expand Down
17 changes: 11 additions & 6 deletions src/quo/components/list_items/token_network/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
{:source (or (:source token) token)
:style style/token-image}]
[rn/view {:style style/token-info}
[text/text {:weight :semi-bold} label]
[text/text
{:weight :semi-bold
:number-of-lines 1}
(if-not (empty? label) label "-")]
[preview-list/view
{:type :network
:size :size-14
:number 3}
:number (count networks)}
networks]]])

(defn- values
Expand All @@ -30,12 +33,14 @@
:accessibility-label :check-icon}]
[rn/view {:style style/values-container}
[text/text
{:weight :medium
:size :paragraph-2}
{:weight :medium
:size :paragraph-2
:number-of-lines 1}
token-value]
[text/text
{:style (style/fiat-value theme)
:size :paragraph-2}
{:style (style/fiat-value theme)
:size :paragraph-2
:number-of-lines 1}
fiat-value]]))

(defn- view-internal
Expand Down
4 changes: 3 additions & 1 deletion src/quo/components/settings/data_item/component_spec.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns quo.components.settings.data-item.component-spec
(:require
[quo.core :as quo]
[quo.foundations.resources :as quo.resources]
[test-helpers.component :as h]))

(h/describe
Expand Down Expand Up @@ -161,7 +162,8 @@
:subtitle "Description"
:icon :i/placeholder
:emoji "🎮"
:customization-color :yellow}])
:customization-color :yellow
:network-image (quo.resources/get-network :ethereum)}])
(h/is-truthy (h/query-by-label-text :description-image)))

(h/test "description emoji is visible when description is account"
Expand Down
11 changes: 6 additions & 5 deletions src/quo/components/settings/data_item/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[quo.components.markdown.text :as text]
[quo.components.settings.data-item.style :as style]
[quo.foundations.colors :as colors]
[quo.foundations.resources :as quo.resources]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[utils.i18n :as i18n]))
Expand All @@ -17,7 +16,8 @@
[rn/view {:style (style/loading-container size blur? theme)}])

(defn- left-subtitle
[{:keys [theme size description icon icon-color blur? subtitle customization-color emoji]}]
[{:keys [theme size description icon icon-color blur? subtitle customization-color emoji
network-image]}]
[rn/view {:style style/subtitle-container}
(when (not= :small size)
[rn/view {:style (style/subtitle-icon-container description)}
Expand All @@ -33,7 +33,7 @@
:type :default}]
:network [rn/image
{:accessibility-label :description-image
:source (quo.resources/tokens :eth)
:source network-image
:style style/image}]
nil)])
[text/text
Expand All @@ -60,7 +60,7 @@
(defn- left-side
"The description can either be given as a string `description` or a component `custom-subtitle`"
[{:keys [theme title status size blur? description custom-subtitle icon subtitle label icon-color
customization-color
customization-color network-image
emoji]
:as props}]
[rn/view {:style style/left-side}
Expand All @@ -85,7 +85,8 @@
:blur? blur?
:subtitle subtitle
:customization-color customization-color
:emoji emoji}]))])
:emoji emoji
:network-image network-image}]))])

(defn- right-side
[{:keys [label icon-right? right-icon icon-color communities-list]}]
Expand Down
Loading

0 comments on commit 23e93ba

Please sign in to comment.