From 2c5cc6cd08bd5d71e336189dd1f0408fd95f739c Mon Sep 17 00:00:00 2001 From: mmilad75 <55688834+mmilad75@users.noreply.github.com> Date: Thu, 9 May 2024 17:10:41 +0330 Subject: [PATCH] 'Send' button is shown for watch-only collectibles and can navigate to the 'send' flow #19743 (#19918) --- .../contexts/wallet/collectible/view.cljs | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/status_im/contexts/wallet/collectible/view.cljs b/src/status_im/contexts/wallet/collectible/view.cljs index 197a7b528b..294f441e1a 100644 --- a/src/status_im/contexts/wallet/collectible/view.cljs +++ b/src/status_im/contexts/wallet/collectible/view.cljs @@ -28,15 +28,16 @@ collection-name]]]) (defn cta-buttons - [chain-id token-id contract-address] + [{:keys [chain-id token-id contract-address watch-only?]}] (let [theme (quo.theme/use-theme)] [rn/view {:style style/buttons-container} - [quo/button - {:container-style style/send-button - :type :outline - :size 40 - :icon-left :i/send} - (i18n/label :t/send)] + (when-not watch-only? + [quo/button + {:container-style style/send-button + :type :outline + :size 40 + :icon-left :i/send} + (i18n/label :t/send)]) [quo/button {:container-style style/opensea-button :type :outline @@ -66,7 +67,7 @@ (let [theme (quo.theme/use-theme) collectible (rf/sub [:wallet/last-collectible-details]) animation-shared-element-id (rf/sub [:animation-shared-element-id]) - wallet-address (rf/sub [:wallet/current-viewing-account-address]) + collectible-owner (rf/sub [:wallet/last-collectible-details-owner]) {:keys [id preview-url collection-data @@ -90,7 +91,7 @@ :header collectible-name :description collection-name} total-owned (utils/total-owned-collectible (:ownership collectible) - wallet-address)] + (:address collectible-owner))] (rn/use-unmount #(rf/dispatch [:wallet/clear-last-collectible-details])) [scroll-page/scroll-page {:navigate-back? true @@ -128,7 +129,11 @@ {:name collectible-name :image preview-uri}])}])}])))}] [header collectible-name collection-name collection-image] - [cta-buttons chain-id token-id contract-address] + [cta-buttons + {:chain-id chain-id + :token-id token-id + :contract-address contract-address + :watch-only? (:watch-only? collectible-owner)}] [quo/tabs {:size 32 :style style/tabs