Wallet: send token from drawer (#18429)

* feat: send token drawer
This commit is contained in:
Omar Basem 2024-01-15 20:57:55 +04:00 committed by GitHub
parent fa9b6edd30
commit 8a16017859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@
(def info
{:flex-direction :row
:align-items :center
:width "60%"})
:width "70%"})
(def token-info
{:height 40
@ -42,7 +42,7 @@
(def values-container
{:align-items :flex-end
:max-width "40%"})
:max-width "30%"})
(defn fiat-value
[theme]

View File

@ -179,6 +179,7 @@
"<$0.01"
(prettify-balance currency-symbol fiat-value)))
(defn calculate-token-value
"This function returns token values in the props of token-value (quo) component"
[{:keys [token color currency currency-symbol]}]

View File

@ -40,6 +40,7 @@
(update-in [:wallet :ui :send] dissoc :route)
(update-in [:wallet :ui :send] dissoc :loading-suggested-routes?))}))
(rf/reg-event-fx :wallet/select-send-account-address
(fn [{:keys [db]} [{:keys [address stack-id]}]]
{:db (-> db

View File

@ -155,9 +155,7 @@
:left-action :dot
:delete-key? true
:on-press handle-keyboard-press
:on-delete handle-delete}]
]
))))
:on-delete handle-delete}]]))))
(defn- view-internal
[props]

View File

@ -118,6 +118,7 @@
(rf/dispatch [:wallet/clean-scanned-address])
(rf/dispatch [:wallet/clean-local-suggestions])
(rf/dispatch [:wallet/clean-account-selection])
(rf/dispatch [:wallet/clean-selected-token])
(rf/dispatch [:wallet/select-address-tab nil])
(rf/dispatch [:navigate-back]))
on-change-tab #(rf/dispatch [:wallet/select-address-tab %])
@ -125,6 +126,7 @@
input-focused? (reagent/atom false)]
(fn []
(let [selected-tab (or (rf/sub [:wallet/send-tab]) (:id (first tabs-data)))
token (rf/sub [:wallet/wallet-send-token])
valid-ens-or-address? (boolean (rf/sub [:wallet/valid-ens-or-address?]))]
(rn/use-effect (fn []
(fn []
@ -143,6 +145,7 @@
:disabled? (not valid-ens-or-address?)
:on-press #(rf/dispatch [:wallet/select-send-address
{:address @input-value
:token token
:stack-id :wallet-select-address}])}
(i18n/label :t/continue)])}
[quo/text-combinations