Compare commits

..
Author SHA1 Message Date
Omar Basem 4e8c3ee1a6 fix send marshall error 2024-07-23 12:13:33 +04:00
6 changed files with 57 additions and 63 deletions
@@ -4,7 +4,8 @@
(defn main
[{:keys [type customization-color]} theme]
{:align-items :center
{:justify-content :center
:align-items :center
:height 32
:padding-left 4
:padding-right 10
@@ -67,9 +67,7 @@
:style (style/main (assoc props :customization-color customization-color) theme)}
[left-view props]
[text/text
{:style (style/label type theme)
:weight :semi-bold
:ellipsize-mode :tail
:number-of-lines 1
:size :heading-1}
{:style (style/label type theme)
:weight :semi-bold
:size :heading-1}
label]]))
@@ -1,16 +1,16 @@
(ns status-im.contexts.wallet.connected-dapps.view
(:require
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im.common.plus-button.view :as plus-button]
[status-im.common.resources :as resources]
[status-im.contexts.wallet.connected-dapps.disconnect-dapp.view :as disconnect-dapp]
[status-im.contexts.wallet.connected-dapps.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[status-im.common.plus-button.view :as plus-button]
[status-im.common.resources :as resources]
[status-im.contexts.wallet.connected-dapps.disconnect-dapp.view :as disconnect-dapp]
[status-im.contexts.wallet.connected-dapps.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(defn- on-disconnect
[wallet-account {:keys [name topic]}]
+22 -21
View File
@@ -450,27 +450,28 @@
network-preferences
gas-rates
from-locked-amount]]
{:db (cond-> db
:always (assoc-in [:wallet :ui :send :amount] amount)
:always (assoc-in [:wallet :ui :send :loading-suggested-routes?] true)
:always (assoc-in [:wallet :ui :send :sender-network-values]
sender-network-values)
:always (assoc-in [:wallet :ui :send :receiver-network-values]
receiver-network-values)
:always (assoc-in [:wallet :ui :send :suggested-routes-call-timestamp] now)
:always (update-in [:wallet :ui :send] dissoc :network-links)
token (assoc-in [:wallet :ui :send :token] token))
:json-rpc/call [{:method "wallet_getSuggestedRoutes"
:params request-params
:on-success (fn [suggested-routes]
(rf/dispatch [:wallet/suggested-routes-success suggested-routes
now]))
:on-error (fn [error]
(rf/dispatch [:wallet/suggested-routes-error error])
(log/error "failed to get suggested routes"
{:event :wallet/get-suggested-routes
:error error
:params request-params}))}]})))
(when (and to-address from-address amount-in token-id)
{:db (cond-> db
:always (assoc-in [:wallet :ui :send :amount] amount)
:always (assoc-in [:wallet :ui :send :loading-suggested-routes?] true)
:always (assoc-in [:wallet :ui :send :sender-network-values]
sender-network-values)
:always (assoc-in [:wallet :ui :send :receiver-network-values]
receiver-network-values)
:always (assoc-in [:wallet :ui :send :suggested-routes-call-timestamp] now)
:always (update-in [:wallet :ui :send] dissoc :network-links)
token (assoc-in [:wallet :ui :send :token] token))
:json-rpc/call [{:method "wallet_getSuggestedRoutes"
:params request-params
:on-success (fn [suggested-routes]
(rf/dispatch [:wallet/suggested-routes-success suggested-routes
now]))
:on-error (fn [error]
(rf/dispatch [:wallet/suggested-routes-error error])
(log/error "failed to get suggested routes"
{:event :wallet/get-suggested-routes
:error error
:params request-params}))}]}))))
(rf/reg-event-fx :wallet/add-authorized-transaction
(fn [{:keys [db]} [transaction]]
@@ -1,15 +1,10 @@
(ns status-im.contexts.wallet.wallet-connect.modals.common.header.style)
(def header-container
{:padding-vertical 12
:flex-direction :column
:align-items :stretch})
{:padding-vertical 12})
(def header-dapp-name
{:flex-direction :row})
(def header-text
{:margin-vertical 4})
{:margin-top -4})
(def header-account-name
{:align-items :flex-start})
{:padding-top 4})
@@ -5,23 +5,22 @@
(defn view
[{:keys [label dapp account]}]
[rn/view {:style style/header-container}
(let [{:keys [name iconUrl]} dapp]
[rn/view {:style style/header-dapp-name}
[rn/view {:flex 1}
[rn/view
{:style style/header-container}
[quo/text
{:size :heading-1
:weight :semi-bold}
(let [{:keys [name iconUrl]} dapp]
[rn/view {:style style/header-dapp-name}
[quo/summary-tag
{:type :dapp
:label name
:image-source iconUrl}]]])
[quo/text
{:size :heading-1
:weight :semi-bold
:style style/header-text}
label]
(let [{:keys [emoji customization-color name]} account]
[rn/view {:style style/header-account-name}
[quo/summary-tag
{:type :account
:emoji emoji
:label name
:customization-color customization-color}]])])
:image-source iconUrl}]])
(str " " label " ")
(let [{:keys [emoji customization-color name]} account]
[rn/view {:style style/header-account-name}
[quo/summary-tag
{:type :account
:emoji emoji
:label name
:customization-color customization-color}]])]])