Skip to content

Commit

Permalink
Merge branch 'develop' into milad/18750-clear-last-collectible-on-leave
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 authored Feb 19, 2024
2 parents ba1a6f6 + 8f85e3c commit ecad567
Show file tree
Hide file tree
Showing 46 changed files with 378 additions and 177 deletions.
2 changes: 1 addition & 1 deletion src/legacy/status_im/node/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
:PeerExchange true
:Port 0
:UDPPort 0
:LightClient true})
:LightClient false})

(def login-node-config
{:WalletConfig (cond-> {:Enabled true}
Expand Down
8 changes: 5 additions & 3 deletions src/quo/components/drawers/drawer_top/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
:description description}]))

(defn- right-icon
[{:keys [theme type on-button-press on-button-long-press button-disabled? button-icon]}]
[{:keys [theme type on-button-press on-button-long-press button-disabled? button-icon button-type]
:or {button-type :primary}}]
(cond
(= :info type)
[icons/icon
Expand All @@ -153,7 +154,7 @@
:on-press on-button-press
:on-long-press on-button-long-press
:disabled? button-disabled?
:type :primary
:type button-type
:size 24
:icon-only? true}
button-icon]))
Expand Down Expand Up @@ -182,7 +183,7 @@

(defn- view-internal
[{:keys [title title-icon type theme description blur? community-name community-logo button-icon
account-name emoji context-tag-type
account-name emoji context-tag-type button-type
on-button-press
on-button-long-press
button-disabled? account-avatar-emoji account-avatar-type customization-color icon-avatar
Expand Down Expand Up @@ -221,6 +222,7 @@
[right-icon
{:theme theme
:type type
:button-type button-type
:on-button-press on-button-press
:on-button-long-press on-button-long-press
:button-disabled? button-disabled?
Expand Down
24 changes: 15 additions & 9 deletions src/quo/components/tags/tag.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
:blurred-border-color colors/white-opa-10
:text-color {:style {:color colors/white}}}}})

(defn- emoji-comp
[size resource]
(let [dimension (case size
32 20
24 12
nil)]
(if (string? resource)
[rn/text {:style {:margin-right 4 :font-size dimension}}
resource]
[rn/image
{:source resource
:style {:margin-right 4 :width dimension :height dimension}}])))

(defn tag-resources
[size type resource icon-color label text-color labelled?]
[rn/view
Expand All @@ -47,13 +60,7 @@
24 12)
:color icon-color}])
(when (= type :emoji)
[text/text
{:style {:margin-right 4}
:size (case size
32 :paragraph-1
24 :paragraph-2
nil)}
resource])
[emoji-comp size resource])
(when labelled?
[text/text
(merge {:size (case size
Expand All @@ -73,7 +80,7 @@
:size 32/24
:on-press fn
:blurred? true/false
:resource icon/image
:resource icon/image/text(emojis)
:labelled? true/false
:disabled? true/false}
Expand Down Expand Up @@ -107,4 +114,3 @@
[tag-resources size type resource icon-color label text-color labelled?]]]))

(def tag (quo.theme/with-theme tag-internal))

6 changes: 4 additions & 2 deletions src/quo/components/text_combinations/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
(defn view-internal
[{:keys [container-style
title
title-number-of-lines
avatar
title-accessibility-label
description
description-accessibility-label
button-icon
button-on-press
customization-color
emoji-hash]}]
emoji-hash]
:or {title-number-of-lines 1}}]
[rn/view {:style container-style}
[rn/view
{:style {:flex-direction :row
Expand All @@ -41,7 +43,7 @@
{:accessibility-label title-accessibility-label
:weight :semi-bold
:ellipsize-mode :tail
:number-of-lines 1
:number-of-lines title-number-of-lines
:size :heading-1}
title]]
(when button-icon
Expand Down
4 changes: 2 additions & 2 deletions src/quo/components/wallet/account_permissions/schema.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns quo.components.wallet.account-permissions.schema
(:require [quo.components.wallet.required-tokens.view :as required-tokens]))
(:require [quo.components.wallet.required-tokens.schema :as required-tokens-schema]))

(def ?schema
[:=>
Expand All @@ -12,7 +12,7 @@
[:address [:maybe :string]]
[:emoji [:maybe :string]]
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]]]
[:token-details {:optional true} [:maybe [:sequential required-tokens/?schema]]]
[:token-details {:optional true} [:maybe [:sequential required-tokens-schema/?schema]]]
[:keycard? {:optional true} [:maybe :boolean]]
[:checked? {:optional true} [:maybe :boolean]]
[:disabled? {:optional true} [:maybe :boolean]]
Expand Down
11 changes: 11 additions & 0 deletions src/quo/components/wallet/network_amount/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(ns quo.components.wallet.network-amount.schema)

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:amount {:optional true} [:maybe :string]]
[:token {:optional true} [:or :keyword :string]]
[:theme :schema.common/theme]]]]
:any])
13 changes: 2 additions & 11 deletions src/quo/components/wallet/network_amount/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
[clojure.string :as string]
[quo.components.markdown.text :as text]
[quo.components.utilities.token.view :as token]
[quo.components.wallet.network-amount.schema :as network-amount-schema]
[quo.components.wallet.network-amount.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[schema.core :as schema]))

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:amount {:optional true} [:maybe :string]]
[:token {:optional true} [:or :keyword :string]]
[:theme :schema.common/theme]]]]
:any])

(defn- view-internal
[{:keys [amount token theme]}]
[rn/view {:style style/container}
Expand All @@ -30,4 +21,4 @@
[rn/view
{:style (style/divider theme)}]])

(def view (quo.theme/with-theme (schema/instrument #'view-internal ?schema)))
(def view (quo.theme/with-theme (schema/instrument #'view-internal network-amount-schema/?schema)))
17 changes: 17 additions & 0 deletions src/quo/components/wallet/network_bridge/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns quo.components.wallet.network-bridge.schema)

(def ^:private ?network-bridge-status
[:enum :add :loading :locked :disabled :default])

(def ?schema
[:=>
[:catn
[:props
[:map
[:theme :schema.common/theme]
[:network {:optional true} [:maybe :keyword]]
[:status {:optional true} [:maybe ?network-bridge-status]]
[:amount {:optional true} [:maybe :string]]
[:container-style {:optional true} [:maybe :map]]
[:on-press {:optional true} [:maybe fn?]]]]]
:any])
19 changes: 2 additions & 17 deletions src/quo/components/wallet/network_bridge/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[clojure.string :as string]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
[quo.components.wallet.network-bridge.schema :as network-bridge-schema]
[quo.components.wallet.network-bridge.style :as style]
[quo.foundations.colors :as colors]
[quo.foundations.resources :as resources]
Expand All @@ -25,22 +26,6 @@
(= network :ethereum) "Mainnet"
:else (string/capitalize (name network))))

(def ^:private ?network-bridge-status
[:enum :add :loading :locked :disabled :default])

(def ?schema
[:=>
[:catn
[:props
[:map
[:theme :schema.common/theme]
[:network {:optional true} [:maybe :keyword]]
[:status {:optional true} [:maybe ?network-bridge-status]]
[:amount {:optional true} [:maybe :string]]
[:container-style {:optional true} [:maybe :map]]
[:on-press {:optional true} [:maybe fn?]]]]]
:any])

(defn view-internal
[{:keys [theme network status amount container-style on-press] :as args}]
(if (= status :add)
Expand Down Expand Up @@ -81,4 +66,4 @@

(def view
(quo.theme/with-theme
(schema/instrument #'view-internal ?schema)))
(schema/instrument #'view-internal network-bridge-schema/?schema)))
17 changes: 17 additions & 0 deletions src/quo/components/wallet/network_routing/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns quo.components.wallet.network-routing.schema)

(def ?schema
[:=>
[:catn
[:props
[:map
[:networks {:optional true}
[:maybe
[:sequential
[:map
[:amount :int]
[:max-amount :int]
[:network-name [:or :string :keyword]]]]]]
[:container-style {:optional true} [:maybe :map]]
[:theme :schema.common/theme]]]]
:any])
19 changes: 2 additions & 17 deletions src/quo/components/wallet/network_routing/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require
[oops.core :as oops]
[quo.components.wallet.network-routing.animation :as animation]
[quo.components.wallet.network-routing.schema :as network-routing-schema]
[quo.components.wallet.network-routing.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
Expand Down Expand Up @@ -173,22 +174,6 @@
[rn/view {:style (style/max-limit-bar-background network-name)}]
[dashed-line network-name]])]))))

(def ?schema
[:=>
[:catn
[:props
[:map
[:networks {:optional true}
[:maybe
[:sequential
[:map
[:amount :int]
[:max-amount :int]
[:network-name [:or :string :keyword]]]]]]
[:container-style {:optional true} [:maybe :map]]
[:theme :schema.common/theme]]]]
:any])

(defn view-internal
[{:keys [networks container-style theme] :as params}]
(reagent/with-let [total-width (reagent/atom nil)]
Expand All @@ -205,4 +190,4 @@

(def view
(quo.theme/with-theme
(schema/instrument #'view-internal ?schema)))
(schema/instrument #'view-internal network-routing-schema/?schema)))
12 changes: 12 additions & 0 deletions src/quo/components/wallet/progress_bar/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(ns quo.components.wallet.progress-bar.schema)

(def ?schema
[:=>
[:catn
[:props
[:map
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
[:theme :schema.common/theme]
[:progressed-value {:optional true} [:maybe [:or :string :int]]]
[:full-width? {:optional true} [:maybe :boolean]]]]]
:any])
14 changes: 2 additions & 12 deletions src/quo/components/wallet/progress_bar/view.cljs
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
(ns quo.components.wallet.progress-bar.view
(:require
[quo.components.wallet.progress-bar.schema :as progress-bar-schema]
[quo.components.wallet.progress-bar.style :as style]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[schema.core :as schema]))

(def ?schema
[:=>
[:catn
[:props
[:map
[:customization-color {:optional true} [:maybe :schema.common/customization-color]]
[:theme :schema.common/theme]
[:progressed-value {:optional true} [:maybe [:or :string :int]]]
[:full-width? {:optional true} [:maybe :boolean]]]]]
:any])

(defn- view-internal
[{:keys [full-width?] :as props}]
[rn/view
Expand All @@ -26,4 +16,4 @@

(def view
(quo.theme/with-theme
(schema/instrument #'view-internal ?schema)))
(schema/instrument #'view-internal progress-bar-schema/?schema)))
17 changes: 17 additions & 0 deletions src/quo/components/wallet/required_tokens/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(ns quo.components.wallet.required-tokens.schema)

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:type [:enum :token :collectible]]
[:amount {:optional true} [:maybe [:or :string :int]]]
[:token {:optional true} [:maybe :string]]
[:token-img-src {:optional true} [:maybe :schema.common/image-source]]
[:collectible-img-src {:optional true} [:maybe :schema.common/image-source]]
[:collectible-name {:optional true} [:maybe :string]]
[:divider? {:optional true} [:maybe :boolean]]
[:theme :schema.common/theme]
[:container-style {:optional true} [:maybe :map]]]]]
:any])
19 changes: 2 additions & 17 deletions src/quo/components/wallet/required_tokens/view.cljs
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
(ns quo.components.wallet.required-tokens.view
(:require [quo.components.markdown.text :as text]
[quo.components.utilities.token.view :as token]
[quo.components.wallet.required-tokens.schema :as required-tokens-schema]
[quo.components.wallet.required-tokens.style :as style]
quo.theme
[react-native.core :as rn]
[schema.core :as schema]))

(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:type [:enum :token :collectible]]
[:amount {:optional true} [:maybe [:or :string :int]]]
[:token {:optional true} [:maybe :string]]
[:token-img-src {:optional true} [:maybe :schema.common/image-source]]
[:collectible-img-src {:optional true} [:maybe :schema.common/image-source]]
[:collectible-name {:optional true} [:maybe :string]]
[:divider? {:optional true} [:maybe :boolean]]
[:theme :schema.common/theme]
[:container-style {:optional true} [:maybe :map]]]]]
:any])

(defn- view-internal
[{:keys [type amount token token-img-src collectible-img-src collectible-name divider? theme
container-style]}]
Expand Down Expand Up @@ -53,4 +38,4 @@

(def view
(quo.theme/with-theme
(schema/instrument #'view-internal ?schema)))
(schema/instrument #'view-internal required-tokens-schema/?schema)))
13 changes: 13 additions & 0 deletions src/quo/components/wallet/summary_info/schema.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(ns quo.components.wallet.summary-info.schema)

(def ?schema
[:=>
[:catn
[:props
[:map
[:theme :schema.common/theme]
[:type [:enum :status-account :saved-account :account :user]]
[:account-props {:optional true} [:maybe :map]]
[:networks? {:optional true} [:maybe :boolean]]
[:values {:optional true} [:maybe :map]]]]]
:any])
Loading

0 comments on commit ecad567

Please sign in to comment.