diff --git a/src/quo/components/wallet/account_permissions/schema.cljs b/src/quo/components/wallet/account_permissions/schema.cljs index a0dd1d95b8..8893b6b52a 100644 --- a/src/quo/components/wallet/account_permissions/schema.cljs +++ b/src/quo/components/wallet/account_permissions/schema.cljs @@ -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 [:=> @@ -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]] diff --git a/src/quo/components/wallet/network_amount/schema.cljs b/src/quo/components/wallet/network_amount/schema.cljs new file mode 100644 index 0000000000..a7baa54e5f --- /dev/null +++ b/src/quo/components/wallet/network_amount/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/network_amount/view.cljs b/src/quo/components/wallet/network_amount/view.cljs index bd6cccc802..2e92a8c6de 100644 --- a/src/quo/components/wallet/network_amount/view.cljs +++ b/src/quo/components/wallet/network_amount/view.cljs @@ -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} @@ -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))) diff --git a/src/quo/components/wallet/network_bridge/schema.cljs b/src/quo/components/wallet/network_bridge/schema.cljs new file mode 100644 index 0000000000..c070baabb2 --- /dev/null +++ b/src/quo/components/wallet/network_bridge/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/network_bridge/view.cljs b/src/quo/components/wallet/network_bridge/view.cljs index e8c934515a..c033ee953a 100644 --- a/src/quo/components/wallet/network_bridge/view.cljs +++ b/src/quo/components/wallet/network_bridge/view.cljs @@ -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] @@ -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) @@ -81,4 +66,4 @@ (def view (quo.theme/with-theme - (schema/instrument #'view-internal ?schema))) + (schema/instrument #'view-internal network-bridge-schema/?schema))) diff --git a/src/quo/components/wallet/network_routing/schema.cljs b/src/quo/components/wallet/network_routing/schema.cljs new file mode 100644 index 0000000000..fec6a7a3d9 --- /dev/null +++ b/src/quo/components/wallet/network_routing/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/network_routing/view.cljs b/src/quo/components/wallet/network_routing/view.cljs index 001e7de64f..a9d1d08528 100644 --- a/src/quo/components/wallet/network_routing/view.cljs +++ b/src/quo/components/wallet/network_routing/view.cljs @@ -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] @@ -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)] @@ -205,4 +190,4 @@ (def view (quo.theme/with-theme - (schema/instrument #'view-internal ?schema))) + (schema/instrument #'view-internal network-routing-schema/?schema))) diff --git a/src/quo/components/wallet/progress_bar/schema.cljs b/src/quo/components/wallet/progress_bar/schema.cljs new file mode 100644 index 0000000000..6ef509a6ac --- /dev/null +++ b/src/quo/components/wallet/progress_bar/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/progress_bar/view.cljs b/src/quo/components/wallet/progress_bar/view.cljs index 9c5f1ed734..f7c7e9e8f7 100644 --- a/src/quo/components/wallet/progress_bar/view.cljs +++ b/src/quo/components/wallet/progress_bar/view.cljs @@ -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 @@ -26,4 +16,4 @@ (def view (quo.theme/with-theme - (schema/instrument #'view-internal ?schema))) + (schema/instrument #'view-internal progress-bar-schema/?schema))) diff --git a/src/quo/components/wallet/required_tokens/schema.cljs b/src/quo/components/wallet/required_tokens/schema.cljs new file mode 100644 index 0000000000..8bf19f6864 --- /dev/null +++ b/src/quo/components/wallet/required_tokens/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/required_tokens/view.cljs b/src/quo/components/wallet/required_tokens/view.cljs index d3a7754e28..e8bfb2c181 100644 --- a/src/quo/components/wallet/required_tokens/view.cljs +++ b/src/quo/components/wallet/required_tokens/view.cljs @@ -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]}] @@ -53,4 +38,4 @@ (def view (quo.theme/with-theme - (schema/instrument #'view-internal ?schema))) + (schema/instrument #'view-internal required-tokens-schema/?schema))) diff --git a/src/quo/components/wallet/summary_info/schema.cljs b/src/quo/components/wallet/summary_info/schema.cljs new file mode 100644 index 0000000000..3d604830b5 --- /dev/null +++ b/src/quo/components/wallet/summary_info/schema.cljs @@ -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]) diff --git a/src/quo/components/wallet/summary_info/view.cljs b/src/quo/components/wallet/summary_info/view.cljs index 697b99718d..375321770d 100644 --- a/src/quo/components/wallet/summary_info/view.cljs +++ b/src/quo/components/wallet/summary_info/view.cljs @@ -4,6 +4,7 @@ [quo.components.avatars.user-avatar.view :as user-avatar] [quo.components.avatars.wallet-user-avatar.view :as wallet-user-avatar] [quo.components.markdown.text :as text] + [quo.components.wallet.summary-info.schema :as summary-info-schema] [quo.components.wallet.summary-info.style :as style] [quo.foundations.colors :as colors] [quo.foundations.resources :as resources] @@ -52,18 +53,6 @@ :amount (str (:amount arbitrum) " " (or (:token-symbol arbitrum) "ARB")) :theme theme}])])) -(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]) - (defn- view-internal [{:keys [theme type account-props networks? values]}] [rn/view @@ -106,4 +95,4 @@ (def view (quo.theme/with-theme - (schema/instrument #'view-internal ?schema))) + (schema/instrument #'view-internal summary-info-schema/?schema)))