From 5c74c360924ee2dd138e6be0ce3c4f9f17a3efbe Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 14:09:19 +0000 Subject: [PATCH 01/29] loop over wallet addresses --- src/status_im/contexts/shell/share/view.cljs | 312 ++++++++++++++++++- 1 file changed, 311 insertions(+), 1 deletion(-) diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 09128cc2853..e2566d2fa39 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -2,20 +2,259 @@ (:require [clojure.string :as string] [legacy.status-im.ui.components.list-selection :as list-selection] + [legacy.status-im.ui.components.react :as react] [quo.core :as quo] [quo.foundations.colors :as colors] [react-native.blur :as blur] [react-native.core :as rn] [react-native.platform :as platform] [react-native.safe-area :as safe-area] + [react-native.share :as share] [reagent.core :as reagent] [status-im.common.qr-codes.view :as qr-codes] [status-im.contexts.profile.utils :as profile.utils] [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] [utils.address :as address] [utils.i18n :as i18n] + [utils.image-server :as image-server] [utils.re-frame :as rf])) +;; (defn header +;; [] +;; [:<> +;; [rn/view {:style style/header-row} +;; [quo/button +;; {:icon-only? true +;; :type :grey +;; :background :blur +;; :size 32 +;; :accessibility-label :close-shell-share-tab +;; :container-style style/header-button +;; :on-press #(rf/dispatch [:navigate-back])} +;; :i/close] +;; [quo/button +;; {:icon-only? true +;; :type :grey +;; :background :blur +;; :size 32 +;; :accessibility-label :shell-scan-button +;; :on-press #(rf/dispatch [:navigate-back])} +;; :i/scan]] +;; [quo/text +;; {:size :heading-1 +;; :weight :semi-bold +;; :style style/header-heading} +;; (i18n/label :t/share)]]) + +;; (defn profile-tab +;; [] +;; (let [{:keys [emoji-hash +;; customization-color +;; universal-profile-url] +;; :as profile} (rf/sub [:profile/profile]) +;; abbreviated-url (address/get-abbreviated-profile-url +;; universal-profile-url) +;; emoji-hash-string (string/join emoji-hash)] +;; [:<> +;; [rn/view {:style style/qr-code-container} +;; [qr-codes/share-qr-code +;; {:type :profile +;; :unblur-on-android? true +;; :qr-data universal-profile-url +;; :qr-data-label-shown abbreviated-url +;; :on-share-press #(list-selection/open-share {:message universal-profile-url}) +;; :on-text-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy universal-profile-url +;; :post-copy-message (i18n/label +;; :t/link-to-profile-copied)}]) +;; :on-text-long-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy universal-profile-url +;; :post-copy-message (i18n/label +;; :t/link-to-profile-copied)}]) +;; :profile-picture (:uri (profile.utils/photo profile)) +;; :full-name (profile.utils/displayed-name profile) +;; :customization-color customization-color}]] + +;; [rn/view {:style style/emoji-hash-container} +;; [rn/view {:style style/emoji-address-container} +;; [rn/view {:style style/emoji-address-column} +;; [quo/text +;; {:size :paragraph-2 +;; :weight :medium +;; :style style/emoji-hash-label} +;; (i18n/label :t/emoji-hash)] +;; [rn/touchable-highlight +;; {:active-opacity 1 +;; :underlay-color colors/neutral-80-opa-1-blur +;; :background-color :transparent +;; :on-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy emoji-hash-string +;; :post-copy-message (i18n/label :t/emoji-hash-copied)}]) +;; :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy emoji-hash-string +;; :post-copy-message (i18n/label :t/emoji-hash-copied)}])} +;; [rn/text {:style style/emoji-hash-content} emoji-hash-string]]]] +;; [rn/view {:style style/emoji-share-button-container} +;; [quo/button +;; {:icon-only? true +;; :type :grey +;; :background :blur +;; :size 32 +;; :accessibility-label :link-to-profile +;; :container-style {:margin-right 12} +;; :on-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy emoji-hash-string +;; :post-copy-message (i18n/label :t/emoji-hash-copied)}]) +;; :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast +;; {:text-to-copy emoji-hash-string +;; :post-copy-message (i18n/label +;; :t/emoji-hash-copied)}])} +;; :i/copy]]]])) + +;; (defn wallet-tab +;; [] +;; (let [{:keys [width]} (rf/sub [:dimensions/window]) +;; wallet-type (reagent/atom :wallet-legacy) +;; ;; Design team is yet to confirm the default selected networks here. +;; ;; Should be the current selected for the account or all the networks always +;; selected-networks (reagent/atom [:ethereum :optimism :arbitrum])] + +;; [react/scroll-view {:horizontal true :keyboard-should-persist-taps true} +;; (let [{:keys [address color emoji] :as account} (rf/sub [:wallet/current-viewing-account]) +;; share-title (str (:name account) " " (i18n/label + ;; :t/address)) +;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type +;; :selected-networks +;; @selected-networks +;; :address address}) +;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url +;; {:url qr-url +;; :port (rf/sub [:mediaserver/port]) +;; :qr-size qr-size +;; :error-level :highest})] +;; [rn/view {:style {:width width}} +;; [quo/share-qr-code +;; {:type @wallet-type +;; :qr-image-uri qr-media-server-uri +;; :qr-data qr-url +;; :networks @selected-networks +;; :on-share-press #(share-action qr-url share-title) +;; :profile-picture nil +;; :unblur-on-android? true +;; :full-name (:name account) +;; :customization-color color +;; :emoji emoji +;; :on-legacy-press #(reset! wallet-type :wallet-legacy) +;; :on-multichain-press #(reset! wallet-type :wallet-multichain) +;; :on-settings-press #(open-preferences selected-networks)}]]) +;; (let [{:keys [address color emoji] :as account} (rf/sub [:wallet/current-viewing-account]) +;; share-title (str (:name account) " " (i18n/label + ;; :t/address)) +;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type +;; :selected-networks +;; @selected-networks +;; :address address}) +;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url +;; {:url qr-url +;; :port (rf/sub [:mediaserver/port]) +;; :qr-size qr-size +;; :error-level :highest})] +;; [rn/view {:style {:width width}} +;; [quo/share-qr-code +;; {:type @wallet-type +;; :qr-image-uri qr-media-server-uri +;; :qr-data qr-url +;; :networks @selected-networks +;; :on-share-press #(share-action qr-url share-title) +;; :profile-picture nil +;; :unblur-on-android? true +;; :full-name (:name account) +;; :customization-color color +;; :emoji emoji +;; :on-legacy-press #(reset! wallet-type :wallet-legacy) +;; :on-multichain-press #(reset! wallet-type :wallet-multichain) +;; :on-settings-press #(open-preferences selected-networks)}]]) +;; ])) + +;; ;; (defn wallet-tab +;; ;; [] +;; ;; (let [wallet-type (reagent/atom :wallet-legacy) +;; ;; ;; Design team is yet to confirm the default selected networks here. +;; ;; ;; Should be the current selected for the account or all the networks always +;; ;; selected-networks (reagent/atom [:ethereum :optimism :arbitrum])] + + +;; ;; (fn [] +;; ;; (let [{:keys [address color emoji] :as account} (rf/sub + ;; [:wallet/current-viewing-account]) +;; ;; share-title (str (:name account) " " (i18n/label + ;; :t/address)) +;; ;; qr-url (utils/get-wallet-qr {:wallet-type + ;; @wallet-type +;; ;; + ;; :selected-networks +;; ;; + ;; @selected-networks +;; ;; :address + ;; address}) +;; ;; qr-media-server-uri + ;; (image-server/get-qr-image-uri-for-any-url +;; ;; {:url qr-url +;; ;; :port (rf/sub + ;; [:mediaserver/port]) +;; ;; :qr-size qr-size +;; ;; :error-level :highest})] + + + +;; ;; [rn/view {:style style/qr-code-container} +;; ;; [quo/share-qr-code +;; ;; {:type @wallet-type +;; ;; :qr-image-uri qr-media-server-uri +;; ;; :qr-data qr-url +;; ;; :networks @selected-networks +;; ;; :on-share-press #(share-action qr-url share-title) +;; ;; :profile-picture nil +;; ;; :unblur-on-android? true +;; ;; :full-name (:name account) +;; ;; :customization-color color +;; ;; :emoji emoji +;; ;; :on-legacy-press #(reset! wallet-type :wallet-legacy) +;; ;; :on-multichain-press #(reset! wallet-type :wallet-multichain) +;; ;; :on-settings-press #(open-preferences selected-networks)}] +;; ;; ])))) + +;; (defn tab-content +;; [] +;; (let [selected-tab (reagent/atom :profile)] +;; (fn [] +;; [:<> +;; [header] +;; [rn/view {:style style/tabs-container} +;; [quo/segmented-control +;; {:size 28 +;; :blur? true +;; :on-change #(reset! selected-tab %) +;; :default-active :profile +;; :data [{:id :profile +;; :label (i18n/label :t/profile)} +;; {:id :wallet +;; :label (i18n/label :t/wallet)}]}]] +;; (if (= @selected-tab :profile) +;; [profile-tab] +;; [wallet-tab])]))) + +;; (defn view +;; [] +;; [rn/view {:flex 1 :padding-top (safe-area/get-top)} +;; [blur/view +;; {:style style/blur +;; :blur-amount 20 +;; :blur-radius (if platform/android? 25 10)}] +;; [tab-content]]) + (defn header [] [:<> @@ -105,9 +344,80 @@ :post-copy-message (i18n/label :t/emoji-hash-copied)}])} :i/copy]]]])) +(def qr-size 500) + +(defn- share-action + [address share-title] + (share/open + (if platform/ios? + {:activity-item-sources [{:placeholder-item {:type "text" + :content address} + :item {:default {:type "text" + :content + address}} + :link-metadata {:title share-title}}]} + {:title share-title + :subject share-title + :message address}))) + + +(defn- open-preferences + [selected-networks] + (rf/dispatch [:show-bottom-sheet + {:theme :dark + :shell? true + :content + (fn [] + [network-preferences/view + {:blur? true + :selected-networks (set @selected-networks) + :on-save (fn [chain-ids] + (rf/dispatch [:hide-bottom-sheet]) + (reset! selected-networks (map #(get utils/id->network %) + chain-ids)))}])}])) (defn wallet-tab [] - [rn/text {:style style/wip-style} "not implemented"]) + (let [accounts (rf/sub [:wallet/accounts]) + selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) + ] + [react/scroll-view {:horizontal false} + + (for [account accounts] + (let [share-title (str (:name account) " " (i18n/label :t/address)) + qr-url (utils/get-wallet-qr {:wallet-type (:type account) + :selected-networks + @selected-networks + :address (:address account)}) + qr-media-server-uri (image-server/get-qr-image-uri-for-any-url + {:url qr-url + :port (rf/sub + [:mediaserver/port]) + :qr-size qr-size + :error-level :highest}) + ] + + [rn/view {:style style/qr-code-container} + [quo/share-qr-code + {:type (:type account) + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name account) + :emoji (:emoji account) + :on-legacy-press #(reset! (:type account) :wallet-legacy) + :on-multichain-press #(reset! ((:type account)) :wallet-multichain) + :on-settings-press #(open-preferences selected-networks) + } + ] + ] + ) + ) + ] + ) +) (defn tab-content [] From 441e2c4395e36d25b8093cd1432d76d93867c8ad Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 18:47:38 +0000 Subject: [PATCH 02/29] correctly render component --- src/status_im/contexts/shell/share/view.cljs | 353 +++++-------------- 1 file changed, 81 insertions(+), 272 deletions(-) diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index e2566d2fa39..0c0b59bae51 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -21,240 +21,6 @@ [utils.image-server :as image-server] [utils.re-frame :as rf])) -;; (defn header -;; [] -;; [:<> -;; [rn/view {:style style/header-row} -;; [quo/button -;; {:icon-only? true -;; :type :grey -;; :background :blur -;; :size 32 -;; :accessibility-label :close-shell-share-tab -;; :container-style style/header-button -;; :on-press #(rf/dispatch [:navigate-back])} -;; :i/close] -;; [quo/button -;; {:icon-only? true -;; :type :grey -;; :background :blur -;; :size 32 -;; :accessibility-label :shell-scan-button -;; :on-press #(rf/dispatch [:navigate-back])} -;; :i/scan]] -;; [quo/text -;; {:size :heading-1 -;; :weight :semi-bold -;; :style style/header-heading} -;; (i18n/label :t/share)]]) - -;; (defn profile-tab -;; [] -;; (let [{:keys [emoji-hash -;; customization-color -;; universal-profile-url] -;; :as profile} (rf/sub [:profile/profile]) -;; abbreviated-url (address/get-abbreviated-profile-url -;; universal-profile-url) -;; emoji-hash-string (string/join emoji-hash)] -;; [:<> -;; [rn/view {:style style/qr-code-container} -;; [qr-codes/share-qr-code -;; {:type :profile -;; :unblur-on-android? true -;; :qr-data universal-profile-url -;; :qr-data-label-shown abbreviated-url -;; :on-share-press #(list-selection/open-share {:message universal-profile-url}) -;; :on-text-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy universal-profile-url -;; :post-copy-message (i18n/label -;; :t/link-to-profile-copied)}]) -;; :on-text-long-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy universal-profile-url -;; :post-copy-message (i18n/label -;; :t/link-to-profile-copied)}]) -;; :profile-picture (:uri (profile.utils/photo profile)) -;; :full-name (profile.utils/displayed-name profile) -;; :customization-color customization-color}]] - -;; [rn/view {:style style/emoji-hash-container} -;; [rn/view {:style style/emoji-address-container} -;; [rn/view {:style style/emoji-address-column} -;; [quo/text -;; {:size :paragraph-2 -;; :weight :medium -;; :style style/emoji-hash-label} -;; (i18n/label :t/emoji-hash)] -;; [rn/touchable-highlight -;; {:active-opacity 1 -;; :underlay-color colors/neutral-80-opa-1-blur -;; :background-color :transparent -;; :on-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy emoji-hash-string -;; :post-copy-message (i18n/label :t/emoji-hash-copied)}]) -;; :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy emoji-hash-string -;; :post-copy-message (i18n/label :t/emoji-hash-copied)}])} -;; [rn/text {:style style/emoji-hash-content} emoji-hash-string]]]] -;; [rn/view {:style style/emoji-share-button-container} -;; [quo/button -;; {:icon-only? true -;; :type :grey -;; :background :blur -;; :size 32 -;; :accessibility-label :link-to-profile -;; :container-style {:margin-right 12} -;; :on-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy emoji-hash-string -;; :post-copy-message (i18n/label :t/emoji-hash-copied)}]) -;; :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast -;; {:text-to-copy emoji-hash-string -;; :post-copy-message (i18n/label -;; :t/emoji-hash-copied)}])} -;; :i/copy]]]])) - -;; (defn wallet-tab -;; [] -;; (let [{:keys [width]} (rf/sub [:dimensions/window]) -;; wallet-type (reagent/atom :wallet-legacy) -;; ;; Design team is yet to confirm the default selected networks here. -;; ;; Should be the current selected for the account or all the networks always -;; selected-networks (reagent/atom [:ethereum :optimism :arbitrum])] - -;; [react/scroll-view {:horizontal true :keyboard-should-persist-taps true} -;; (let [{:keys [address color emoji] :as account} (rf/sub [:wallet/current-viewing-account]) -;; share-title (str (:name account) " " (i18n/label - ;; :t/address)) -;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type -;; :selected-networks -;; @selected-networks -;; :address address}) -;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url -;; {:url qr-url -;; :port (rf/sub [:mediaserver/port]) -;; :qr-size qr-size -;; :error-level :highest})] -;; [rn/view {:style {:width width}} -;; [quo/share-qr-code -;; {:type @wallet-type -;; :qr-image-uri qr-media-server-uri -;; :qr-data qr-url -;; :networks @selected-networks -;; :on-share-press #(share-action qr-url share-title) -;; :profile-picture nil -;; :unblur-on-android? true -;; :full-name (:name account) -;; :customization-color color -;; :emoji emoji -;; :on-legacy-press #(reset! wallet-type :wallet-legacy) -;; :on-multichain-press #(reset! wallet-type :wallet-multichain) -;; :on-settings-press #(open-preferences selected-networks)}]]) -;; (let [{:keys [address color emoji] :as account} (rf/sub [:wallet/current-viewing-account]) -;; share-title (str (:name account) " " (i18n/label - ;; :t/address)) -;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type -;; :selected-networks -;; @selected-networks -;; :address address}) -;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url -;; {:url qr-url -;; :port (rf/sub [:mediaserver/port]) -;; :qr-size qr-size -;; :error-level :highest})] -;; [rn/view {:style {:width width}} -;; [quo/share-qr-code -;; {:type @wallet-type -;; :qr-image-uri qr-media-server-uri -;; :qr-data qr-url -;; :networks @selected-networks -;; :on-share-press #(share-action qr-url share-title) -;; :profile-picture nil -;; :unblur-on-android? true -;; :full-name (:name account) -;; :customization-color color -;; :emoji emoji -;; :on-legacy-press #(reset! wallet-type :wallet-legacy) -;; :on-multichain-press #(reset! wallet-type :wallet-multichain) -;; :on-settings-press #(open-preferences selected-networks)}]]) -;; ])) - -;; ;; (defn wallet-tab -;; ;; [] -;; ;; (let [wallet-type (reagent/atom :wallet-legacy) -;; ;; ;; Design team is yet to confirm the default selected networks here. -;; ;; ;; Should be the current selected for the account or all the networks always -;; ;; selected-networks (reagent/atom [:ethereum :optimism :arbitrum])] - - -;; ;; (fn [] -;; ;; (let [{:keys [address color emoji] :as account} (rf/sub - ;; [:wallet/current-viewing-account]) -;; ;; share-title (str (:name account) " " (i18n/label - ;; :t/address)) -;; ;; qr-url (utils/get-wallet-qr {:wallet-type - ;; @wallet-type -;; ;; - ;; :selected-networks -;; ;; - ;; @selected-networks -;; ;; :address - ;; address}) -;; ;; qr-media-server-uri - ;; (image-server/get-qr-image-uri-for-any-url -;; ;; {:url qr-url -;; ;; :port (rf/sub - ;; [:mediaserver/port]) -;; ;; :qr-size qr-size -;; ;; :error-level :highest})] - - - -;; ;; [rn/view {:style style/qr-code-container} -;; ;; [quo/share-qr-code -;; ;; {:type @wallet-type -;; ;; :qr-image-uri qr-media-server-uri -;; ;; :qr-data qr-url -;; ;; :networks @selected-networks -;; ;; :on-share-press #(share-action qr-url share-title) -;; ;; :profile-picture nil -;; ;; :unblur-on-android? true -;; ;; :full-name (:name account) -;; ;; :customization-color color -;; ;; :emoji emoji -;; ;; :on-legacy-press #(reset! wallet-type :wallet-legacy) -;; ;; :on-multichain-press #(reset! wallet-type :wallet-multichain) -;; ;; :on-settings-press #(open-preferences selected-networks)}] -;; ;; ])))) - -;; (defn tab-content -;; [] -;; (let [selected-tab (reagent/atom :profile)] -;; (fn [] -;; [:<> -;; [header] -;; [rn/view {:style style/tabs-container} -;; [quo/segmented-control -;; {:size 28 -;; :blur? true -;; :on-change #(reset! selected-tab %) -;; :default-active :profile -;; :data [{:id :profile -;; :label (i18n/label :t/profile)} -;; {:id :wallet -;; :label (i18n/label :t/wallet)}]}]] -;; (if (= @selected-tab :profile) -;; [profile-tab] -;; [wallet-tab])]))) - -;; (defn view -;; [] -;; [rn/view {:flex 1 :padding-top (safe-area/get-top)} -;; [blur/view -;; {:style style/blur -;; :blur-amount 20 -;; :blur-radius (if platform/android? 25 10)}] -;; [tab-content]]) - (defn header [] [:<> @@ -375,49 +141,92 @@ (rf/dispatch [:hide-bottom-sheet]) (reset! selected-networks (map #(get utils/id->network %) chain-ids)))}])}])) + (defn wallet-tab [] (let [accounts (rf/sub [:wallet/accounts]) - selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) - ] - [react/scroll-view {:horizontal false} + selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) + wallet-type (reagent/atom :wallet-legacy)] + + (when (seq accounts) + (fn [] + (let [share-title (str (:name (first accounts)) " " (i18n/label :t/address)) + qr-url (utils/get-wallet-qr {:wallet-type @wallet-type + :selected-networks @selected-networks + :address (:address (first accounts))}) + qr-media-server-uri (image-server/get-qr-image-uri-for-any-url + {:url qr-url + :port (rf/sub [:mediaserver/port]) + :qr-size qr-size + :error-level :highest})] + [rn/view {:key (:name (first accounts)) :style style/qr-code-container} + [quo/share-qr-code + {:type @wallet-type + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name (first accounts)) + :customization-color (:color (first accounts)) + :emoji (:emoji (first accounts)) + :on-multichain-press #(reset! wallet-type :wallet-multichain) + :on-legacy-press #(reset! wallet-type :wallet-legacy) + :on-settings-press #(open-preferences selected-networks)}]] + ))))) - (for [account accounts] - (let [share-title (str (:name account) " " (i18n/label :t/address)) - qr-url (utils/get-wallet-qr {:wallet-type (:type account) - :selected-networks - @selected-networks - :address (:address account)}) - qr-media-server-uri (image-server/get-qr-image-uri-for-any-url - {:url qr-url - :port (rf/sub - [:mediaserver/port]) - :qr-size qr-size - :error-level :highest}) - ] - [rn/view {:style style/qr-code-container} - [quo/share-qr-code - {:type (:type account) - :qr-image-uri qr-media-server-uri - :qr-data qr-url - :networks @selected-networks - :on-share-press #(share-action qr-url share-title) - :profile-picture nil - :unblur-on-android? true - :full-name (:name account) - :emoji (:emoji account) - :on-legacy-press #(reset! (:type account) :wallet-legacy) - :on-multichain-press #(reset! ((:type account)) :wallet-multichain) - :on-settings-press #(open-preferences selected-networks) - } - ] - ] - ) - ) - ] - ) -) + ;; (doall + ;; (for [account accounts] + ;; (let [share-title (str (:name account) " " (i18n/label :t/address)) + ;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type + ;; :selected-networks + ;; @selected-networks + ;; :address (:address account)}) + ;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url + ;; {:url qr-url + ;; :port (rf/sub + ;; [:mediaserver/port]) + ;; :qr-size qr-size + ;; :error-level :highest})] + + + ;; [rn/view {:key (:name account) :style style/qr-code-container} + ;; [rn/pressable + ;; {:on-press #(js/alert {:number-of-accounts account})] + ;; :style + ;; {:flex 1 + ;; :padding-vertical 10 + ;; :padding-horizontal 20} + ;; :title (:name account)} + ;; [rn/text (:name account)] + ;; [rn/text (:address account)] + ;; [rn/text (:emoji account)] + ;; [rn/text (:color account)] + + ;; ;; wallet address below + ;; [rn/text (:address account)] + ;; ;; wallet type below + ;; [rn/text (:type account)] + ;; [rn/text share-title] + ;; [rn/text qr-url] + ;; [rn/text qr-media-server-uri]] + ;; [quo/share-qr-code + ;; {:type @wallet-type + ;; :qr-image-uri qr-media-server-uri + ;; :qr-data qr-url + ;; :networks @selected-networks + ;; :on-share-press #(share-action qr-url share-title) + ;; :profile-picture nil + ;; :unblur-on-android? true + ;; :full-name (:name account) + ;; :customization-color (:color account) + ;; :emoji (:emoji account) + ;; :on-legacy-press #(reset! wallet-type :wallet-legacy) + ;; :on-multichain-press #(reset! wallet-type :wallet-multichain) + ;; :on-settings-press #(open-preferences selected-networks)}]])))]] + (defn tab-content [] From 6a45216aa29b3f454688896ffddd950cb276c557 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 19:44:48 +0000 Subject: [PATCH 03/29] show all wallets and enable scrolling --- src/status_im/contexts/shell/share/view.cljs | 116 ++++++------------- 1 file changed, 33 insertions(+), 83 deletions(-) diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 0c0b59bae51..d66795f0c03 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -141,92 +141,42 @@ (rf/dispatch [:hide-bottom-sheet]) (reset! selected-networks (map #(get utils/id->network %) chain-ids)))}])}])) - -(defn wallet-tab - [] - (let [accounts (rf/sub [:wallet/accounts]) - selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) +(defn wallet-qr-code-item + [account] + (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) wallet-type (reagent/atom :wallet-legacy)] - - (when (seq accounts) - (fn [] - (let [share-title (str (:name (first accounts)) " " (i18n/label :t/address)) - qr-url (utils/get-wallet-qr {:wallet-type @wallet-type - :selected-networks @selected-networks - :address (:address (first accounts))}) + (fn [] + (let [share-title (str (:name account) " " (i18n/label :t/address)) + qr-url (utils/get-wallet-qr {:wallet-type @wallet-type + :selected-networks @selected-networks + :address (:address account)}) qr-media-server-uri (image-server/get-qr-image-uri-for-any-url - {:url qr-url - :port (rf/sub [:mediaserver/port]) - :qr-size qr-size - :error-level :highest})] - [rn/view {:key (:name (first accounts)) :style style/qr-code-container} - [quo/share-qr-code - {:type @wallet-type - :qr-image-uri qr-media-server-uri - :qr-data qr-url - :networks @selected-networks - :on-share-press #(share-action qr-url share-title) - :profile-picture nil - :unblur-on-android? true - :full-name (:name (first accounts)) - :customization-color (:color (first accounts)) - :emoji (:emoji (first accounts)) - :on-multichain-press #(reset! wallet-type :wallet-multichain) - :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]] - ))))) - - - ;; (doall - ;; (for [account accounts] - ;; (let [share-title (str (:name account) " " (i18n/label :t/address)) - ;; qr-url (utils/get-wallet-qr {:wallet-type @wallet-type - ;; :selected-networks - ;; @selected-networks - ;; :address (:address account)}) - ;; qr-media-server-uri (image-server/get-qr-image-uri-for-any-url - ;; {:url qr-url - ;; :port (rf/sub - ;; [:mediaserver/port]) - ;; :qr-size qr-size - ;; :error-level :highest})] - - - ;; [rn/view {:key (:name account) :style style/qr-code-container} - ;; [rn/pressable - ;; {:on-press #(js/alert {:number-of-accounts account})] - ;; :style - ;; {:flex 1 - ;; :padding-vertical 10 - ;; :padding-horizontal 20} - ;; :title (:name account)} - ;; [rn/text (:name account)] - ;; [rn/text (:address account)] - ;; [rn/text (:emoji account)] - ;; [rn/text (:color account)] - - ;; ;; wallet address below - ;; [rn/text (:address account)] - ;; ;; wallet type below - ;; [rn/text (:type account)] - ;; [rn/text share-title] - ;; [rn/text qr-url] - ;; [rn/text qr-media-server-uri]] - ;; [quo/share-qr-code - ;; {:type @wallet-type - ;; :qr-image-uri qr-media-server-uri - ;; :qr-data qr-url - ;; :networks @selected-networks - ;; :on-share-press #(share-action qr-url share-title) - ;; :profile-picture nil - ;; :unblur-on-android? true - ;; :full-name (:name account) - ;; :customization-color (:color account) - ;; :emoji (:emoji account) - ;; :on-legacy-press #(reset! wallet-type :wallet-legacy) - ;; :on-multichain-press #(reset! wallet-type :wallet-multichain) - ;; :on-settings-press #(open-preferences selected-networks)}]])))]] + {:url qr-url + :port (rf/sub [:mediaserver/port]) + :qr-size qr-size + :error-level :highest})] + [rn/view {:key (:name account) :style style/qr-code-container} + [quo/share-qr-code + {:type @wallet-type + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name account) + :customization-color (:color account) + :emoji (:emoji account) + :on-multichain-press #(reset! wallet-type :wallet-multichain) + :on-legacy-press #(reset! wallet-type :wallet-legacy) + :on-settings-press #(open-preferences selected-networks)}]])))) +(defn wallet-tab + [] + (let [accounts (rf/sub [:wallet/accounts])] + [react/scroll-view {:horizontal true :content-container-style {:flex 1}} + (for [account accounts] + [wallet-qr-code-item account])])) (defn tab-content [] From 7a1389b9c37a4d509533fde35e550bf72f077b1c Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 19:57:01 +0000 Subject: [PATCH 04/29] fix width in scroll view --- src/status_im/contexts/shell/share/view.cljs | 37 +++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index d66795f0c03..8238a05a948 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -144,7 +144,8 @@ (defn wallet-qr-code-item [account] (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) - wallet-type (reagent/atom :wallet-legacy)] + wallet-type (reagent/atom :wallet-legacy) + width (rf/sub [:dimensions/window-width])] (fn [] (let [share-title (str (:name account) " " (i18n/label :t/address)) qr-url (utils/get-wallet-qr {:wallet-type @wallet-type @@ -155,26 +156,28 @@ :port (rf/sub [:mediaserver/port]) :qr-size qr-size :error-level :highest})] - [rn/view {:key (:name account) :style style/qr-code-container} - [quo/share-qr-code - {:type @wallet-type - :qr-image-uri qr-media-server-uri - :qr-data qr-url - :networks @selected-networks - :on-share-press #(share-action qr-url share-title) - :profile-picture nil - :unblur-on-android? true - :full-name (:name account) - :customization-color (:color account) - :emoji (:emoji account) - :on-multichain-press #(reset! wallet-type :wallet-multichain) - :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]])))) + [rn/view {:style {:width width}} + [rn/view {:key (:name account) :style style/qr-code-container} + [quo/share-qr-code + {:type @wallet-type + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name account) + :customization-color (:color account) + :emoji (:emoji account) + :on-multichain-press #(reset! wallet-type :wallet-multichain) + :on-legacy-press #(reset! wallet-type :wallet-legacy) + :on-settings-press #(open-preferences selected-networks)}]]] + )))) (defn wallet-tab [] (let [accounts (rf/sub [:wallet/accounts])] - [react/scroll-view {:horizontal true :content-container-style {:flex 1}} + [react/scroll-view {:horizontal true :style {:flex 1}} (for [account accounts] [wallet-qr-code-item account])])) From fdfae82ca3c1715a1e17f0d77e7efa7367b50dbe Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 21:38:13 +0000 Subject: [PATCH 05/29] add key to correct element --- src/status_im/contexts/shell/share/view.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 8238a05a948..5d587253e6a 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -157,7 +157,7 @@ :qr-size qr-size :error-level :highest})] [rn/view {:style {:width width}} - [rn/view {:key (:name account) :style style/qr-code-container} + [rn/view { :style style/qr-code-container} [quo/share-qr-code {:type @wallet-type :qr-image-uri qr-media-server-uri @@ -179,7 +179,7 @@ (let [accounts (rf/sub [:wallet/accounts])] [react/scroll-view {:horizontal true :style {:flex 1}} (for [account accounts] - [wallet-qr-code-item account])])) + [wallet-qr-code-item account {:key (:key-uid account)}])])) (defn tab-content [] From 5134badd7ca431eca0c77f716c9c10763c4d6cea Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 22:41:54 +0000 Subject: [PATCH 06/29] separate out components --- .../contexts/shell/share/profile/view.cljs | 75 ++++++++ src/status_im/contexts/shell/share/view.cljs | 170 ++---------------- .../contexts/shell/share/wallet/view.cljs | 86 +++++++++ 3 files changed, 175 insertions(+), 156 deletions(-) create mode 100644 src/status_im/contexts/shell/share/profile/view.cljs create mode 100644 src/status_im/contexts/shell/share/wallet/view.cljs diff --git a/src/status_im/contexts/shell/share/profile/view.cljs b/src/status_im/contexts/shell/share/profile/view.cljs new file mode 100644 index 00000000000..59e39ce50eb --- /dev/null +++ b/src/status_im/contexts/shell/share/profile/view.cljs @@ -0,0 +1,75 @@ +(ns status-im.contexts.shell.share.profile.view + (:require + [clojure.string :as string] + [legacy.status-im.ui.components.list-selection :as list-selection] + [quo.core :as quo] + [quo.foundations.colors :as colors] + [react-native.core :as rn] + [status-im.common.qr-codes.view :as qr-codes] + [status-im.contexts.profile.utils :as profile.utils] + [status-im.contexts.shell.share.style :as style] + [utils.address :as address] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(defn profile-tab + [] + (let [{:keys [emoji-hash + customization-color + universal-profile-url] + :as profile} (rf/sub [:profile/profile]) + abbreviated-url (address/get-abbreviated-profile-url + universal-profile-url) + emoji-hash-string (string/join emoji-hash)] + [:<> + [rn/view {:style style/qr-code-container} + [qr-codes/share-qr-code + {:type :profile + :unblur-on-android? true + :qr-data universal-profile-url + :qr-data-label-shown abbreviated-url + :on-share-press #(list-selection/open-share {:message universal-profile-url}) + :on-text-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy universal-profile-url + :post-copy-message (i18n/label :t/link-to-profile-copied)}]) + :on-text-long-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy universal-profile-url + :post-copy-message (i18n/label :t/link-to-profile-copied)}]) + :profile-picture (:uri (profile.utils/photo profile)) + :full-name (profile.utils/displayed-name profile) + :customization-color customization-color}]] + + [rn/view {:style style/emoji-hash-container} + [rn/view {:style style/emoji-address-container} + [rn/view {:style style/emoji-address-column} + [quo/text + {:size :paragraph-2 + :weight :medium + :style style/emoji-hash-label} + (i18n/label :t/emoji-hash)] + [rn/touchable-highlight + {:active-opacity 1 + :underlay-color colors/neutral-80-opa-1-blur + :background-color :transparent + :on-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy emoji-hash-string + :post-copy-message (i18n/label :t/emoji-hash-copied)}]) + :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy emoji-hash-string + :post-copy-message (i18n/label :t/emoji-hash-copied)}])} + [rn/text {:style style/emoji-hash-content} emoji-hash-string]]]] + [rn/view {:style style/emoji-share-button-container} + [quo/button + {:icon-only? true + :type :grey + :background :blur + :size 32 + :accessibility-label :link-to-profile + :container-style {:margin-right 12} + :on-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy emoji-hash-string + :post-copy-message (i18n/label :t/emoji-hash-copied)}]) + :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast + {:text-to-copy emoji-hash-string + :post-copy-message (i18n/label :t/emoji-hash-copied)}])} + :i/copy]]]])) \ No newline at end of file diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 5d587253e6a..4701327bb92 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -1,25 +1,16 @@ (ns status-im.contexts.shell.share.view - (:require - [clojure.string :as string] - [legacy.status-im.ui.components.list-selection :as list-selection] - [legacy.status-im.ui.components.react :as react] - [quo.core :as quo] - [quo.foundations.colors :as colors] - [react-native.blur :as blur] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.safe-area :as safe-area] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.common.qr-codes.view :as qr-codes] - [status-im.contexts.profile.utils :as profile.utils] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.address :as address] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + (:require + [quo.core :as quo] + [react-native.blur :as blur] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.safe-area :as safe-area] + [reagent.core :as reagent] + [status-im.contexts.shell.share.profile.view :as profile-view] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.shell.share.wallet.view :as wallet-view] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) (defn header [] @@ -48,139 +39,6 @@ :style style/header-heading} (i18n/label :t/share)]]) -(defn profile-tab - [] - (let [{:keys [emoji-hash - customization-color - universal-profile-url] - :as profile} (rf/sub [:profile/profile]) - abbreviated-url (address/get-abbreviated-profile-url - universal-profile-url) - emoji-hash-string (string/join emoji-hash)] - [:<> - [rn/view {:style style/qr-code-container} - [qr-codes/share-qr-code - {:type :profile - :unblur-on-android? true - :qr-data universal-profile-url - :qr-data-label-shown abbreviated-url - :on-share-press #(list-selection/open-share {:message universal-profile-url}) - :on-text-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy universal-profile-url - :post-copy-message (i18n/label :t/link-to-profile-copied)}]) - :on-text-long-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy universal-profile-url - :post-copy-message (i18n/label :t/link-to-profile-copied)}]) - :profile-picture (:uri (profile.utils/photo profile)) - :full-name (profile.utils/displayed-name profile) - :customization-color customization-color}]] - - [rn/view {:style style/emoji-hash-container} - [rn/view {:style style/emoji-address-container} - [rn/view {:style style/emoji-address-column} - [quo/text - {:size :paragraph-2 - :weight :medium - :style style/emoji-hash-label} - (i18n/label :t/emoji-hash)] - [rn/touchable-highlight - {:active-opacity 1 - :underlay-color colors/neutral-80-opa-1-blur - :background-color :transparent - :on-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy emoji-hash-string - :post-copy-message (i18n/label :t/emoji-hash-copied)}]) - :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy emoji-hash-string - :post-copy-message (i18n/label :t/emoji-hash-copied)}])} - [rn/text {:style style/emoji-hash-content} emoji-hash-string]]]] - [rn/view {:style style/emoji-share-button-container} - [quo/button - {:icon-only? true - :type :grey - :background :blur - :size 32 - :accessibility-label :link-to-profile - :container-style {:margin-right 12} - :on-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy emoji-hash-string - :post-copy-message (i18n/label :t/emoji-hash-copied)}]) - :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast - {:text-to-copy emoji-hash-string - :post-copy-message (i18n/label :t/emoji-hash-copied)}])} - :i/copy]]]])) - -(def qr-size 500) - -(defn- share-action - [address share-title] - (share/open - (if platform/ios? - {:activity-item-sources [{:placeholder-item {:type "text" - :content address} - :item {:default {:type "text" - :content - address}} - :link-metadata {:title share-title}}]} - {:title share-title - :subject share-title - :message address}))) - - -(defn- open-preferences - [selected-networks] - (rf/dispatch [:show-bottom-sheet - {:theme :dark - :shell? true - :content - (fn [] - [network-preferences/view - {:blur? true - :selected-networks (set @selected-networks) - :on-save (fn [chain-ids] - (rf/dispatch [:hide-bottom-sheet]) - (reset! selected-networks (map #(get utils/id->network %) - chain-ids)))}])}])) -(defn wallet-qr-code-item - [account] - (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) - wallet-type (reagent/atom :wallet-legacy) - width (rf/sub [:dimensions/window-width])] - (fn [] - (let [share-title (str (:name account) " " (i18n/label :t/address)) - qr-url (utils/get-wallet-qr {:wallet-type @wallet-type - :selected-networks @selected-networks - :address (:address account)}) - qr-media-server-uri (image-server/get-qr-image-uri-for-any-url - {:url qr-url - :port (rf/sub [:mediaserver/port]) - :qr-size qr-size - :error-level :highest})] - [rn/view {:style {:width width}} - [rn/view { :style style/qr-code-container} - [quo/share-qr-code - {:type @wallet-type - :qr-image-uri qr-media-server-uri - :qr-data qr-url - :networks @selected-networks - :on-share-press #(share-action qr-url share-title) - :profile-picture nil - :unblur-on-android? true - :full-name (:name account) - :customization-color (:color account) - :emoji (:emoji account) - :on-multichain-press #(reset! wallet-type :wallet-multichain) - :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]]] - )))) - -(defn wallet-tab - [] - (let [accounts (rf/sub [:wallet/accounts])] - [react/scroll-view {:horizontal true :style {:flex 1}} - (for [account accounts] - [wallet-qr-code-item account {:key (:key-uid account)}])])) - (defn tab-content [] (let [selected-tab (reagent/atom :profile)] @@ -198,8 +56,8 @@ {:id :wallet :label (i18n/label :t/wallet)}]}]] (if (= @selected-tab :profile) - [profile-tab] - [wallet-tab])]))) + [profile-view/profile-tab] + [wallet-view/wallet-tab])]))) (defn view [] diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs new file mode 100644 index 00000000000..567ca59b56a --- /dev/null +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -0,0 +1,86 @@ +(ns status-im.contexts.shell.share.wallet.view + (:require + [legacy.status-im.ui.components.react :as react] + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) + +(def qr-size 500) + +(defn- share-action + [address share-title] + (share/open + (if platform/ios? + {:activity-item-sources [{:placeholder-item {:type "text" + :content address} + :item {:default {:type "text" + :content + address}} + :link-metadata {:title share-title}}]} + {:title share-title + :subject share-title + :message address}))) + + +(defn- open-preferences + [selected-networks] + (rf/dispatch [:show-bottom-sheet + {:theme :dark + :shell? true + :content + (fn [] + [network-preferences/view + {:blur? true + :selected-networks (set @selected-networks) + :on-save (fn [chain-ids] + (rf/dispatch [:hide-bottom-sheet]) + (reset! selected-networks (map #(get utils/id->network %) + chain-ids)))}])}])) +(defn wallet-qr-code-item + [account] + (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) + wallet-type (reagent/atom :wallet-legacy) + width (rf/sub [:dimensions/window-width])] + (fn [] + (let [share-title (str (:name account) " " (i18n/label :t/address)) + qr-url (utils/get-wallet-qr {:wallet-type @wallet-type + :selected-networks @selected-networks + :address (:address account)}) + qr-media-server-uri (image-server/get-qr-image-uri-for-any-url + {:url qr-url + :port (rf/sub [:mediaserver/port]) + :qr-size qr-size + :error-level :highest})] + [rn/view {:style {:width width}} + [rn/view {:style style/qr-code-container} + [quo/share-qr-code + {:type @wallet-type + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name account) + :customization-color (:color account) + :emoji (:emoji account) + :on-multichain-press #(reset! wallet-type :wallet-multichain) + :on-legacy-press #(reset! wallet-type :wallet-legacy) + :on-settings-press #(open-preferences selected-networks)}]]] + )))) + +(defn wallet-tab + [] + (let [accounts (rf/sub [:wallet/accounts])] + [react/scroll-view {:horizontal true} + (for [account accounts] + ^{:key (:address account)} + [wallet-qr-code-item account])])) \ No newline at end of file From 96820329047f627554c5dad362b07ddf63afa404 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 4 Jan 2024 22:45:50 +0000 Subject: [PATCH 07/29] run make lint --- .../contexts/shell/share/profile/view.cljs | 22 +++---- src/status_im/contexts/shell/share/view.cljs | 24 +++---- .../contexts/shell/share/wallet/view.cljs | 62 +++++++++---------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/status_im/contexts/shell/share/profile/view.cljs b/src/status_im/contexts/shell/share/profile/view.cljs index 59e39ce50eb..cbe56e4eb8d 100644 --- a/src/status_im/contexts/shell/share/profile/view.cljs +++ b/src/status_im/contexts/shell/share/profile/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.profile.view (:require - [clojure.string :as string] - [legacy.status-im.ui.components.list-selection :as list-selection] - [quo.core :as quo] - [quo.foundations.colors :as colors] - [react-native.core :as rn] - [status-im.common.qr-codes.view :as qr-codes] - [status-im.contexts.profile.utils :as profile.utils] - [status-im.contexts.shell.share.style :as style] - [utils.address :as address] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) + [clojure.string :as string] + [legacy.status-im.ui.components.list-selection :as list-selection] + [quo.core :as quo] + [quo.foundations.colors :as colors] + [react-native.core :as rn] + [status-im.common.qr-codes.view :as qr-codes] + [status-im.contexts.profile.utils :as profile.utils] + [status-im.contexts.shell.share.style :as style] + [utils.address :as address] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) (defn profile-tab [] diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 4701327bb92..ecb708998a5 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.view - (:require - [quo.core :as quo] - [react-native.blur :as blur] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.safe-area :as safe-area] - [reagent.core :as reagent] - [status-im.contexts.shell.share.profile.view :as profile-view] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.shell.share.wallet.view :as wallet-view] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) + (:require + [quo.core :as quo] + [react-native.blur :as blur] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.safe-area :as safe-area] + [reagent.core :as reagent] + [status-im.contexts.shell.share.profile.view :as profile-view] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.shell.share.wallet.view :as wallet-view] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) (defn header [] diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index 567ca59b56a..b481369ce35 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,17 +1,17 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [legacy.status-im.ui.components.react :as react] - [quo.core :as quo] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + [legacy.status-im.ui.components.react :as react] + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) (def qr-size 500) @@ -48,7 +48,7 @@ [account] (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) wallet-type (reagent/atom :wallet-legacy) - width (rf/sub [:dimensions/window-width])] + width (rf/sub [:dimensions/window-width])] (fn [] (let [share-title (str (:name account) " " (i18n/label :t/address)) qr-url (utils/get-wallet-qr {:wallet-type @wallet-type @@ -59,28 +59,28 @@ :port (rf/sub [:mediaserver/port]) :qr-size qr-size :error-level :highest})] - [rn/view {:style {:width width}} - [rn/view {:style style/qr-code-container} - [quo/share-qr-code - {:type @wallet-type - :qr-image-uri qr-media-server-uri - :qr-data qr-url - :networks @selected-networks - :on-share-press #(share-action qr-url share-title) - :profile-picture nil - :unblur-on-android? true - :full-name (:name account) - :customization-color (:color account) - :emoji (:emoji account) - :on-multichain-press #(reset! wallet-type :wallet-multichain) - :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]]] - )))) + [rn/view {:style {:width width}} + [rn/view {:style style/qr-code-container} + [quo/share-qr-code + {:type @wallet-type + :qr-image-uri qr-media-server-uri + :qr-data qr-url + :networks @selected-networks + :on-share-press #(share-action qr-url share-title) + :profile-picture nil + :unblur-on-android? true + :full-name (:name account) + :customization-color (:color account) + :emoji (:emoji account) + :on-multichain-press #(reset! wallet-type :wallet-multichain) + :on-legacy-press #(reset! wallet-type :wallet-legacy) + :on-settings-press #(open-preferences selected-networks)}]]] + )))) (defn wallet-tab [] (let [accounts (rf/sub [:wallet/accounts])] - [react/scroll-view {:horizontal true} + [react/scroll-view {:horizontal true} (for [account accounts] ^{:key (:address account)} [wallet-qr-code-item account])])) \ No newline at end of file From 836de017c567b5d74ef64e8f808d87f1b4762618 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 13:32:27 +0000 Subject: [PATCH 08/29] setup tests --- src/status_im/core_spec.cljs | 3 ++- test/jest/jestSetup.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/status_im/core_spec.cljs b/src/status_im/core_spec.cljs index cda0e3d1e30..cb8955ea102 100644 --- a/src/status_im/core_spec.cljs +++ b/src/status_im/core_spec.cljs @@ -3,7 +3,8 @@ [status-im.common.floating-button-page.component-spec] [status-im.contexts.chat.messenger.messages.content.audio.component-spec] [status-im.contexts.communities.actions.community-options.component-spec] + [status-im.contexts.shell.share.wallet.component-spec] [status-im.contexts.wallet.add-address-to-watch.component-spec] [status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec] [status-im.contexts.wallet.create-account.edit-derivation-path.component-spec] - [status-im.contexts.wallet.send.input-amount.component-spec])) + [status-im.contexts.wallet.send.input-amount.component-spec])) \ No newline at end of file diff --git a/test/jest/jestSetup.js b/test/jest/jestSetup.js index 217b79d4815..58d8d77da3f 100644 --- a/test/jest/jestSetup.js +++ b/test/jest/jestSetup.js @@ -11,6 +11,10 @@ jest.mock('react-native-fs', () => ({ default: {}, })); +jest.mock('react-native-share', () => ({ + default: {}, +})); + jest.mock('react-native-navigation', () => ({ getNavigationConstants: () => ({ constants: [] }), Navigation: { From d1d993f3de5aa9477055b9415a78938804ddb29a Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 14:55:16 +0000 Subject: [PATCH 09/29] update view --- .../contexts/shell/share/wallet/view.cljs | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index b481369ce35..b04bb8c686c 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,6 +1,5 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [legacy.status-im.ui.components.react :as react] [quo.core :as quo] [react-native.core :as rn] [react-native.platform :as platform] @@ -45,10 +44,9 @@ (reset! selected-networks (map #(get utils/id->network %) chain-ids)))}])}])) (defn wallet-qr-code-item - [account] + [account width index] (let [selected-networks (reagent/atom [:ethereum :optimism :arbitrum]) - wallet-type (reagent/atom :wallet-legacy) - width (rf/sub [:dimensions/window-width])] + wallet-type (reagent/atom :wallet-legacy)] (fn [] (let [share-title (str (:name account) " " (i18n/label :t/address)) qr-url (utils/get-wallet-qr {:wallet-type @wallet-type @@ -59,7 +57,7 @@ :port (rf/sub [:mediaserver/port]) :qr-size qr-size :error-level :highest})] - [rn/view {:style {:width width}} + [rn/view {:style {:width width :margin-left (if (zero? index) 0 -30)}} [rn/view {:style style/qr-code-container} [quo/share-qr-code {:type @wallet-type @@ -79,8 +77,19 @@ (defn wallet-tab [] - (let [accounts (rf/sub [:wallet/accounts])] - [react/scroll-view {:horizontal true} - (for [account accounts] - ^{:key (:address account)} - [wallet-qr-code-item account])])) \ No newline at end of file + (let [accounts (rf/sub [:wallet/accounts]) + width (rf/sub [:dimensions/window-width])] + [rn/view {:style {:flex 1}} + [rn/scroll-view + {:horizontal true + :deceleration-rate 0.9 + :snap-to-alignment "start" + :snap-to-interval (- 500 30) + :disable-interval-momentum true + :scroll-event-throttle 64 + } + (map-indexed + (fn [index account] + ^{:key (:address account)} + [wallet-qr-code-item account width index]) + accounts)]])) From 5cd0af39e251996bc273e947cc8e9646eec9f9d7 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 15:05:46 +0000 Subject: [PATCH 10/29] add tests --- .../components/share/share_qr_code/view.cljs | 2 +- .../contexts/shell/share/profile/view.cljs | 22 +++++----- .../shell/share/wallet/component_spec.cljs | 44 +++++++++++++++++++ src/status_im/core_spec.cljs | 2 +- 4 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 src/status_im/contexts/shell/share/wallet/component_spec.cljs diff --git a/src/quo/components/share/share_qr_code/view.cljs b/src/quo/components/share/share_qr_code/view.cljs index fa02c018b68..4e79024bdfd 100644 --- a/src/quo/components/share/share_qr_code/view.cljs +++ b/src/quo/components/share/share_qr_code/view.cljs @@ -191,7 +191,7 @@ bad because of the `blur/view`, so we can set `unblur-on-android? true` to fix it. " [{:keys [unblur-on-android?] :as props}] - (reagent/with-let [component-width (reagent/atom nil) + (reagent/with-let [component-width (reagent/atom 0) container-component (if (and platform/android? unblur-on-android?) [rn/view {:background-color style/overlay-color}] [blur/view diff --git a/src/status_im/contexts/shell/share/profile/view.cljs b/src/status_im/contexts/shell/share/profile/view.cljs index cbe56e4eb8d..59e39ce50eb 100644 --- a/src/status_im/contexts/shell/share/profile/view.cljs +++ b/src/status_im/contexts/shell/share/profile/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.profile.view (:require - [clojure.string :as string] - [legacy.status-im.ui.components.list-selection :as list-selection] - [quo.core :as quo] - [quo.foundations.colors :as colors] - [react-native.core :as rn] - [status-im.common.qr-codes.view :as qr-codes] - [status-im.contexts.profile.utils :as profile.utils] - [status-im.contexts.shell.share.style :as style] - [utils.address :as address] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) + [clojure.string :as string] + [legacy.status-im.ui.components.list-selection :as list-selection] + [quo.core :as quo] + [quo.foundations.colors :as colors] + [react-native.core :as rn] + [status-im.common.qr-codes.view :as qr-codes] + [status-im.contexts.profile.utils :as profile.utils] + [status-im.contexts.shell.share.style :as style] + [utils.address :as address] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) (defn profile-tab [] diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs new file mode 100644 index 00000000000..3b1166e020d --- /dev/null +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -0,0 +1,44 @@ +(ns status-im.contexts.shell.share.wallet.component-spec + (:require + [status-im.contexts.shell.share.wallet.view :as wallet-view] + status-im.contexts.wallet.events + [test-helpers.component :as h])) + + +(defn render-wallet-view + [] + (let [component-rendered (h/render [wallet-view/wallet-tab]) + rerender-fn (h/get-rerender-fn component-rendered) + share-qr-code (h/get-by-label-text :share-qr-code) + ] + ;; Fires on-layout since it's needed to render the content + (h/fire-event :layout share-qr-code #js {:nativeEvent #js {:layout #js {:width 500}}}) + (rerender-fn [wallet-view/wallet-tab]))) + +(h/describe "share wallet accounts" + (h/setup-restorable-re-frame) + (h/before-each + (fn [] + (h/setup-subs {:dimensions/window-width 500 + :mediaserver/port 200 + :wallet/accounts [{:type :wallet-multichain + :address "0x707f635951193ddafbb40971a0fcaab8a6415160" + :name "Wallet One" + :emoji "😆" + :color :blue}]}))) + (h/test "should display the the wallet account" + (h/render [wallet-view/wallet-tab]) + (h/is-truthy (h/get-by-text "Wallet One"))) + (h/test "should display the the multichain account" + (h/render [wallet-view/wallet-tab]) + ;; (render-wallet-view) + (h/fire-event :press (h/get-by-label-text :share-qr-code-multichain-tab)) + (-> (h/wait-for #(h/is-truthy (h/query-by-text "eth:"))))) + + (h/test "should display the the legacy account" + (h/render [wallet-view/wallet-tab]) + ;; (render-wallet-view) + (h/fire-event :press (h/get-by-label-text :share-qr-code-legacy-tab)) + (-> (h/wait-for #(h/is-falsy (h/query-by-text "eth:")))))) + + diff --git a/src/status_im/core_spec.cljs b/src/status_im/core_spec.cljs index cb8955ea102..673095197dd 100644 --- a/src/status_im/core_spec.cljs +++ b/src/status_im/core_spec.cljs @@ -7,4 +7,4 @@ [status-im.contexts.wallet.add-address-to-watch.component-spec] [status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec] [status-im.contexts.wallet.create-account.edit-derivation-path.component-spec] - [status-im.contexts.wallet.send.input-amount.component-spec])) \ No newline at end of file + [status-im.contexts.wallet.send.input-amount.component-spec])) From 3c006e0c40772446f04122092e0445078569d015 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 15:07:21 +0000 Subject: [PATCH 11/29] width fix --- src/status_im/contexts/shell/share/wallet/view.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index b04bb8c686c..2db3103ac80 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -84,7 +84,7 @@ {:horizontal true :deceleration-rate 0.9 :snap-to-alignment "start" - :snap-to-interval (- 500 30) + :snap-to-interval (- width 30) :disable-interval-momentum true :scroll-event-throttle 64 } From fc7abe16ec381964da8f55e073dbd6cc3bc71c13 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 18:34:28 +0000 Subject: [PATCH 12/29] update tests --- .../components/share/share_qr_code/view.cljs | 4 ++- .../contexts/shell/share/profile/view.cljs | 24 ++++++------- .../shell/share/wallet/component_spec.cljs | 34 ++++++++++--------- .../contexts/shell/share/wallet/view.cljs | 2 +- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/quo/components/share/share_qr_code/view.cljs b/src/quo/components/share/share_qr_code/view.cljs index 4e79024bdfd..f381ea66142 100644 --- a/src/quo/components/share/share_qr_code/view.cljs +++ b/src/quo/components/share/share_qr_code/view.cljs @@ -127,6 +127,8 @@ profile-picture emoji on-share-press] :as props}] [rn/view {:style style/content-container} + (prn "hello") + (prn component-width) [rn/view {:style style/share-qr-container} [rn/view @@ -191,7 +193,7 @@ bad because of the `blur/view`, so we can set `unblur-on-android? true` to fix it. " [{:keys [unblur-on-android?] :as props}] - (reagent/with-let [component-width (reagent/atom 0) + (reagent/with-let [component-width (reagent/atom nil) container-component (if (and platform/android? unblur-on-android?) [rn/view {:background-color style/overlay-color}] [blur/view diff --git a/src/status_im/contexts/shell/share/profile/view.cljs b/src/status_im/contexts/shell/share/profile/view.cljs index 59e39ce50eb..7b4b3c79acc 100644 --- a/src/status_im/contexts/shell/share/profile/view.cljs +++ b/src/status_im/contexts/shell/share/profile/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.profile.view (:require - [clojure.string :as string] - [legacy.status-im.ui.components.list-selection :as list-selection] - [quo.core :as quo] - [quo.foundations.colors :as colors] - [react-native.core :as rn] - [status-im.common.qr-codes.view :as qr-codes] - [status-im.contexts.profile.utils :as profile.utils] - [status-im.contexts.shell.share.style :as style] - [utils.address :as address] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) + [clojure.string :as string] + [legacy.status-im.ui.components.list-selection :as list-selection] + [quo.core :as quo] + [quo.foundations.colors :as colors] + [react-native.core :as rn] + [status-im.common.qr-codes.view :as qr-codes] + [status-im.contexts.profile.utils :as profile.utils] + [status-im.contexts.shell.share.style :as style] + [utils.address :as address] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) (defn profile-tab [] @@ -72,4 +72,4 @@ :on-long-press #(rf/dispatch [:share/copy-text-and-show-toast {:text-to-copy emoji-hash-string :post-copy-message (i18n/label :t/emoji-hash-copied)}])} - :i/copy]]]])) \ No newline at end of file + :i/copy]]]])) diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index 3b1166e020d..50ab7f58c7c 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -4,15 +4,13 @@ status-im.contexts.wallet.events [test-helpers.component :as h])) - (defn render-wallet-view [] (let [component-rendered (h/render [wallet-view/wallet-tab]) rerender-fn (h/get-rerender-fn component-rendered) - share-qr-code (h/get-by-label-text :share-qr-code) - ] + share-qr-code (h/get-by-label-text :share-qr-code)] ;; Fires on-layout since it's needed to render the content - (h/fire-event :layout share-qr-code #js {:nativeEvent #js {:layout #js {:width 500}}}) + (h/fire-event :layout share-qr-code #js {:nativeEvent #js {:layout #js {:width 500}}}) (rerender-fn [wallet-view/wallet-tab]))) (h/describe "share wallet accounts" @@ -26,19 +24,23 @@ :name "Wallet One" :emoji "😆" :color :blue}]}))) - (h/test "should display the the wallet account" - (h/render [wallet-view/wallet-tab]) - (h/is-truthy (h/get-by-text "Wallet One"))) - (h/test "should display the the multichain account" - (h/render [wallet-view/wallet-tab]) - ;; (render-wallet-view) - (h/fire-event :press (h/get-by-label-text :share-qr-code-multichain-tab)) - (-> (h/wait-for #(h/is-truthy (h/query-by-text "eth:"))))) + (h/test "should display the the wallet tab" + (render-wallet-view) + (h/wait-for #(h/is-truthy (h/get-by-text "Wallet One")))) (h/test "should display the the legacy account" - (h/render [wallet-view/wallet-tab]) - ;; (render-wallet-view) - (h/fire-event :press (h/get-by-label-text :share-qr-code-legacy-tab)) - (-> (h/wait-for #(h/is-falsy (h/query-by-text "eth:")))))) + (render-wallet-view) + (-> (h/wait-for #(h/get-by-label-text :share-qr-code-legacy-tab)) + (.then (fn [] + (h/fire-event :press (h/get-by-label-text :share-qr-code-legacy-tab)) + (-> (h/wait-for #(h/is-falsy (h/query-by-text "eth:")))))))) + + (h/test "should display the the multichain account" + (render-wallet-view) + (-> (h/wait-for #(h/get-by-label-text :share-qr-code-multichain-tab)) + (.then (fn [] + (h/fire-event :press (h/get-by-label-text :share-qr-code-multichain-tab)) + (-> (h/wait-for #(h/is-truthy (h/query-by-text "eth:")))))))) +) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index 2db3103ac80..a5dbcaddcc1 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -58,7 +58,7 @@ :qr-size qr-size :error-level :highest})] [rn/view {:style {:width width :margin-left (if (zero? index) 0 -30)}} - [rn/view {:style style/qr-code-container} + [rn/view {:style style/qr-code-container} [quo/share-qr-code {:type @wallet-type :qr-image-uri qr-media-server-uri From 32eeca086d7ac678e0e6644d41e7869cd30f1fbe Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 18:37:04 +0000 Subject: [PATCH 13/29] remove type from test --- Makefile | 2 +- shadow-cljs.edn | 6 ++++-- src/quo/components/share/share_qr_code/view.cljs | 2 -- .../contexts/shell/share/wallet/component_spec.cljs | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2cd07363918..b5a6a9fbaa8 100644 --- a/Makefile +++ b/Makefile @@ -388,7 +388,7 @@ component-test-watch: export JEST_USE_SILENT_REPORTER := false component-test-watch: ##@ Watch tests and re-run no changes to cljs files @@scripts/check-metro-shadow-process.sh rm -rf ./component-spec - yarn install + # yarn install nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js --testEnvironment node ' -e cljs component-test: export TARGET := clojure diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 634110408ef..dd2f277eb6f 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -156,8 +156,10 @@ test-helpers.component-tests-preload status-im.setup.schema-preload - quo.core-spec - status-im.core-spec] + ;; quo.core-spec + ;; status-im.core-spec + status-im.contexts.shell.share.wallet.component-spec + ] :ns-regexp "component-spec$" :output-dir "component-spec" :closure-defines {schema.core/throw-on-error? true} diff --git a/src/quo/components/share/share_qr_code/view.cljs b/src/quo/components/share/share_qr_code/view.cljs index f381ea66142..fa02c018b68 100644 --- a/src/quo/components/share/share_qr_code/view.cljs +++ b/src/quo/components/share/share_qr_code/view.cljs @@ -127,8 +127,6 @@ profile-picture emoji on-share-press] :as props}] [rn/view {:style style/content-container} - (prn "hello") - (prn component-width) [rn/view {:style style/share-qr-container} [rn/view diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index 50ab7f58c7c..22fba7d9566 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -19,8 +19,7 @@ (fn [] (h/setup-subs {:dimensions/window-width 500 :mediaserver/port 200 - :wallet/accounts [{:type :wallet-multichain - :address "0x707f635951193ddafbb40971a0fcaab8a6415160" + :wallet/accounts [{:address "0x707f635951193ddafbb40971a0fcaab8a6415160" :name "Wallet One" :emoji "😆" :color :blue}]}))) From 483558f319eb71ed796c551713c520d85139e9a0 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 18:38:40 +0000 Subject: [PATCH 14/29] revert makefile --- Makefile | 2 +- shadow-cljs.edn | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b5a6a9fbaa8..2cd07363918 100644 --- a/Makefile +++ b/Makefile @@ -388,7 +388,7 @@ component-test-watch: export JEST_USE_SILENT_REPORTER := false component-test-watch: ##@ Watch tests and re-run no changes to cljs files @@scripts/check-metro-shadow-process.sh rm -rf ./component-spec - # yarn install + yarn install nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js --testEnvironment node ' -e cljs component-test: export TARGET := clojure diff --git a/shadow-cljs.edn b/shadow-cljs.edn index dd2f277eb6f..634110408ef 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -156,10 +156,8 @@ test-helpers.component-tests-preload status-im.setup.schema-preload - ;; quo.core-spec - ;; status-im.core-spec - status-im.contexts.shell.share.wallet.component-spec - ] + quo.core-spec + status-im.core-spec] :ns-regexp "component-spec$" :output-dir "component-spec" :closure-defines {schema.core/throw-on-error? true} From fcc3de3babda91d9f656f13b0773ba6744031eea Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 18:39:28 +0000 Subject: [PATCH 15/29] remove line break --- src/status_im/contexts/shell/share/wallet/component_spec.cljs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index 22fba7d9566..a6692fb19ef 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -39,7 +39,5 @@ (-> (h/wait-for #(h/get-by-label-text :share-qr-code-multichain-tab)) (.then (fn [] (h/fire-event :press (h/get-by-label-text :share-qr-code-multichain-tab)) - (-> (h/wait-for #(h/is-truthy (h/query-by-text "eth:")))))))) - -) + (-> (h/wait-for #(h/is-truthy (h/query-by-text "eth:"))))))))) From 99b5d76fde31d3576d6eaf59bffdda0ad3de4d5d Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 20:36:42 +0000 Subject: [PATCH 16/29] remove unneeded flex --- src/status_im/contexts/shell/share/wallet/view.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index a5dbcaddcc1..8fa7aebad77 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -79,7 +79,7 @@ [] (let [accounts (rf/sub [:wallet/accounts]) width (rf/sub [:dimensions/window-width])] - [rn/view {:style {:flex 1}} + [rn/view [rn/scroll-view {:horizontal true :deceleration-rate 0.9 @@ -87,7 +87,7 @@ :snap-to-interval (- width 30) :disable-interval-momentum true :scroll-event-throttle 64 - } + } (map-indexed (fn [index account] ^{:key (:address account)} From 1290771898a4287f1b9a04a30d7255776407275b Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 20:38:15 +0000 Subject: [PATCH 17/29] remove line break --- src/status_im/contexts/shell/share/wallet/view.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index 8fa7aebad77..a7e5521152b 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -28,7 +28,6 @@ :subject share-title :message address}))) - (defn- open-preferences [selected-networks] (rf/dispatch [:show-bottom-sheet From ad0150583d1c97def8376cc81716eee0791fe13b Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 20:51:23 +0000 Subject: [PATCH 18/29] update test description --- src/status_im/contexts/shell/share/wallet/component_spec.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index a6692fb19ef..460d63bd9f8 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -13,7 +13,7 @@ (h/fire-event :layout share-qr-code #js {:nativeEvent #js {:layout #js {:width 500}}}) (rerender-fn [wallet-view/wallet-tab]))) -(h/describe "share wallet accounts" +(h/describe "share wallet addresses" (h/setup-restorable-re-frame) (h/before-each (fn [] From 4af7f7a42dd61468c7d839291bb8179987a6d91f Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Sat, 6 Jan 2024 21:15:47 +0000 Subject: [PATCH 19/29] add line break in test file --- src/status_im/contexts/shell/share/wallet/component_spec.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index 460d63bd9f8..fb51f8a728e 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -23,6 +23,7 @@ :name "Wallet One" :emoji "😆" :color :blue}]}))) + (h/test "should display the the wallet tab" (render-wallet-view) (h/wait-for #(h/is-truthy (h/get-by-text "Wallet One")))) From 67c1fdfb1d0013818fb42f98edade966701a327d Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 8 Jan 2024 09:42:06 +0000 Subject: [PATCH 20/29] formatting --- src/status_im/contexts/shell/share/wallet/view.cljs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index a7e5521152b..ba8d6e4fa91 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -57,7 +57,7 @@ :qr-size qr-size :error-level :highest})] [rn/view {:style {:width width :margin-left (if (zero? index) 0 -30)}} - [rn/view {:style style/qr-code-container} + [rn/view {:style style/qr-code-container} [quo/share-qr-code {:type @wallet-type :qr-image-uri qr-media-server-uri @@ -71,8 +71,7 @@ :emoji (:emoji account) :on-multichain-press #(reset! wallet-type :wallet-multichain) :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]]] - )))) + :on-settings-press #(open-preferences selected-networks)}]]])))) (defn wallet-tab [] From add668d81837312cab5824eeeb26b55062cf3610 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 8 Jan 2024 09:42:38 +0000 Subject: [PATCH 21/29] format rn/scroll-view options --- src/status_im/contexts/shell/share/wallet/view.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index ba8d6e4fa91..73274c8e523 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -84,8 +84,7 @@ :snap-to-alignment "start" :snap-to-interval (- width 30) :disable-interval-momentum true - :scroll-event-throttle 64 - } + :scroll-event-throttle 64} (map-indexed (fn [index account] ^{:key (:address account)} From 77f36ab01c217cc588938b44c333ee79e5c11197 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 8 Jan 2024 12:06:45 +0000 Subject: [PATCH 22/29] update to use FlatList over scroll view --- .../shell/share/wallet/component_spec.cljs | 2 +- .../contexts/shell/share/wallet/view.cljs | 23 ++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/component_spec.cljs b/src/status_im/contexts/shell/share/wallet/component_spec.cljs index fb51f8a728e..b0e00244523 100644 --- a/src/status_im/contexts/shell/share/wallet/component_spec.cljs +++ b/src/status_im/contexts/shell/share/wallet/component_spec.cljs @@ -23,7 +23,7 @@ :name "Wallet One" :emoji "😆" :color :blue}]}))) - + (h/test "should display the the wallet tab" (render-wallet-view) (h/wait-for #(h/is-truthy (h/get-by-text "Wallet One")))) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index 73274c8e523..8931c319366 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -77,16 +77,13 @@ [] (let [accounts (rf/sub [:wallet/accounts]) width (rf/sub [:dimensions/window-width])] - [rn/view - [rn/scroll-view - {:horizontal true - :deceleration-rate 0.9 - :snap-to-alignment "start" - :snap-to-interval (- width 30) - :disable-interval-momentum true - :scroll-event-throttle 64} - (map-indexed - (fn [index account] - ^{:key (:address account)} - [wallet-qr-code-item account width index]) - accounts)]])) + [rn/flat-list + {:horizontal true + :deceleration-rate 0.9 + :snap-to-alignment "start" + :snap-to-interval (- width 30) + :disable-interval-momentum true + :scroll-event-throttle 64 + :data accounts + :render-fn (fn [account index] + (wallet-qr-code-item account width index))}])) From cc9f2f0064b6c62399208e3e7f8ace0079fafe3b Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 8 Jan 2024 14:15:50 +0000 Subject: [PATCH 23/29] update open-preferences --- .../contexts/shell/share/wallet/view.cljs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index 8931c319366..e975c954bea 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [quo.core :as quo] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) (def qr-size 500) @@ -37,7 +37,7 @@ (fn [] [network-preferences/view {:blur? true - :selected-networks (set @selected-networks) + :selected-networks (set selected-networks) :on-save (fn [chain-ids] (rf/dispatch [:hide-bottom-sheet]) (reset! selected-networks (map #(get utils/id->network %) @@ -71,12 +71,12 @@ :emoji (:emoji account) :on-multichain-press #(reset! wallet-type :wallet-multichain) :on-legacy-press #(reset! wallet-type :wallet-legacy) - :on-settings-press #(open-preferences selected-networks)}]]])))) + :on-settings-press #(open-preferences @selected-networks)}]]])))) (defn wallet-tab [] (let [accounts (rf/sub [:wallet/accounts]) - width (rf/sub [:dimensions/window-width])] + width (rf/sub [:dimensions/window-width])] [rn/flat-list {:horizontal true :deceleration-rate 0.9 From 6aa16c828b335731ec3393cb9181aef43fc6cc47 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 8 Jan 2024 15:04:54 +0000 Subject: [PATCH 24/29] make lint fix --- .../contexts/shell/share/wallet/view.cljs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index e975c954bea..bc03d130757 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [quo.core :as quo] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) (def qr-size 500) @@ -76,7 +76,7 @@ (defn wallet-tab [] (let [accounts (rf/sub [:wallet/accounts]) - width (rf/sub [:dimensions/window-width])] + width (rf/sub [:dimensions/window-width])] [rn/flat-list {:horizontal true :deceleration-rate 0.9 From 644e51d336f15c36a0085bbe4933cd943f78780b Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Wed, 10 Jan 2024 09:39:04 +0000 Subject: [PATCH 25/29] remove files --- .clj-kondo/rewrite-clj/rewrite-clj/config.edn | 5 ----- .clj-kondo/taoensso/encore/config.edn | 1 - .clj-kondo/taoensso/encore/taoensso/encore.clj | 16 ---------------- 3 files changed, 22 deletions(-) delete mode 100644 .clj-kondo/rewrite-clj/rewrite-clj/config.edn delete mode 100644 .clj-kondo/taoensso/encore/config.edn delete mode 100644 .clj-kondo/taoensso/encore/taoensso/encore.clj diff --git a/.clj-kondo/rewrite-clj/rewrite-clj/config.edn b/.clj-kondo/rewrite-clj/rewrite-clj/config.edn deleted file mode 100644 index 19ecae96a0f..00000000000 --- a/.clj-kondo/rewrite-clj/rewrite-clj/config.edn +++ /dev/null @@ -1,5 +0,0 @@ -{:lint-as - {rewrite-clj.zip/subedit-> clojure.core/-> - rewrite-clj.zip/subedit->> clojure.core/->> - rewrite-clj.zip/edit-> clojure.core/-> - rewrite-clj.zip/edit->> clojure.core/->>}} diff --git a/.clj-kondo/taoensso/encore/config.edn b/.clj-kondo/taoensso/encore/config.edn deleted file mode 100644 index 7b0ff3c2b7b..00000000000 --- a/.clj-kondo/taoensso/encore/config.edn +++ /dev/null @@ -1 +0,0 @@ -{:hooks {:analyze-call {taoensso.encore/defalias taoensso.encore/defalias}}} diff --git a/.clj-kondo/taoensso/encore/taoensso/encore.clj b/.clj-kondo/taoensso/encore/taoensso/encore.clj deleted file mode 100644 index 7f6d30ac94e..00000000000 --- a/.clj-kondo/taoensso/encore/taoensso/encore.clj +++ /dev/null @@ -1,16 +0,0 @@ -(ns taoensso.encore - (:require - [clj-kondo.hooks-api :as hooks])) - -(defn defalias [{:keys [node]}] - (let [[sym-raw src-raw] (rest (:children node)) - src (if src-raw src-raw sym-raw) - sym (if src-raw - sym-raw - (symbol (name (hooks/sexpr src))))] - {:node (with-meta - (hooks/list-node - [(hooks/token-node 'def) - (hooks/token-node (hooks/sexpr sym)) - (hooks/token-node (hooks/sexpr src))]) - (meta src))})) From 98b2e07fe9e7711874fcb99b3f98a49de048f371 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 11 Jan 2024 14:31:34 +0000 Subject: [PATCH 26/29] fix share issue --- .../contexts/shell/share/wallet/view.cljs | 42 ++++++++++--------- .../contexts/wallet/receive/view.cljs | 15 +++---- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index bc03d130757..e03a9afdfff 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [quo.core :as quo] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) (def qr-size 500) @@ -18,15 +18,17 @@ [address share-title] (share/open (if platform/ios? - {:activity-item-sources [{:placeholder-item {:type "text" - :content address} - :item {:default {:type "text" - :content - address}} - :link-metadata {:title share-title}}]} + {:activityItemSources [{:placeholderItem {:type "text" + :content address} + :item {:default {:type "text" + :content + address}} + :linkMetadata {:title share-title}}]} {:title share-title :subject share-title - :message address}))) + :message address + :isNewTask true}))) + (defn- open-preferences [selected-networks] @@ -34,7 +36,7 @@ {:theme :dark :shell? true :content - (fn [] + (fn [] [network-preferences/view {:blur? true :selected-networks (set selected-networks) @@ -63,7 +65,7 @@ :qr-image-uri qr-media-server-uri :qr-data qr-url :networks @selected-networks - :on-share-press #(share-action qr-url share-title) + :on-share-press #(share-action qr-url share-title) :profile-picture nil :unblur-on-android? true :full-name (:name account) diff --git a/src/status_im/contexts/wallet/receive/view.cljs b/src/status_im/contexts/wallet/receive/view.cljs index 8f983971877..5b3734410f8 100644 --- a/src/status_im/contexts/wallet/receive/view.cljs +++ b/src/status_im/contexts/wallet/receive/view.cljs @@ -19,15 +19,16 @@ [address share-title] (share/open (if platform/ios? - {:activity-item-sources [{:placeholder-item {:type "text" - :content address} - :item {:default {:type "text" - :content - address}} - :link-metadata {:title share-title}}]} + {:activityItemSources [{:placeholderItem {:type "text" + :content address} + :item {:default {:type "text" + :content + address}} + :linkMetadata {:title share-title}}]} {:title share-title :subject share-title - :message address}))) + :message address + :isNewTask true}))) (defn- open-preferences [selected-networks] From 938ad1c6ca6796ea2db63ae25f411b42f6b030b2 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 11 Jan 2024 14:42:10 +0000 Subject: [PATCH 27/29] lint --- .../contexts/shell/share/wallet/view.cljs | 32 +++++++++---------- .../contexts/wallet/receive/view.cljs | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index e03a9afdfff..a021c51059b 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -1,16 +1,16 @@ (ns status-im.contexts.shell.share.wallet.view (:require - [quo.core :as quo] - [react-native.core :as rn] - [react-native.platform :as platform] - [react-native.share :as share] - [reagent.core :as reagent] - [status-im.contexts.shell.share.style :as style] - [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] - [status-im.contexts.wallet.common.utils :as utils] - [utils.i18n :as i18n] - [utils.image-server :as image-server] - [utils.re-frame :as rf])) + [quo.core :as quo] + [react-native.core :as rn] + [react-native.platform :as platform] + [react-native.share :as share] + [reagent.core :as reagent] + [status-im.contexts.shell.share.style :as style] + [status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences] + [status-im.contexts.wallet.common.utils :as utils] + [utils.i18n :as i18n] + [utils.image-server :as image-server] + [utils.re-frame :as rf])) (def qr-size 500) @@ -24,9 +24,9 @@ :content address}} :linkMetadata {:title share-title}}]} - {:title share-title - :subject share-title - :message address + {:title share-title + :subject share-title + :message address :isNewTask true}))) @@ -36,7 +36,7 @@ {:theme :dark :shell? true :content - (fn [] + (fn [] [network-preferences/view {:blur? true :selected-networks (set selected-networks) @@ -65,7 +65,7 @@ :qr-image-uri qr-media-server-uri :qr-data qr-url :networks @selected-networks - :on-share-press #(share-action qr-url share-title) + :on-share-press #(share-action qr-url share-title) :profile-picture nil :unblur-on-android? true :full-name (:name account) diff --git a/src/status_im/contexts/wallet/receive/view.cljs b/src/status_im/contexts/wallet/receive/view.cljs index 5b3734410f8..e256f0dde35 100644 --- a/src/status_im/contexts/wallet/receive/view.cljs +++ b/src/status_im/contexts/wallet/receive/view.cljs @@ -25,9 +25,9 @@ :content address}} :linkMetadata {:title share-title}}]} - {:title share-title - :subject share-title - :message address + {:title share-title + :subject share-title + :message address :isNewTask true}))) (defn- open-preferences From cac2e7d8c9d9cc97384cbf960690a0bc9dc04736 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Thu, 11 Jan 2024 15:05:02 +0000 Subject: [PATCH 28/29] add directional --- src/status_im/contexts/shell/share/wallet/view.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index a021c51059b..dfb137e2c53 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -87,5 +87,6 @@ :disable-interval-momentum true :scroll-event-throttle 64 :data accounts + :directional-lock-enabled true :render-fn (fn [account index] (wallet-qr-code-item account width index))}])) From 24e4e6f5e5b1ef7f0cd5bde07c968306944ca1f8 Mon Sep 17 00:00:00 2001 From: Paul Fitzgerald Date: Mon, 15 Jan 2024 09:45:05 +0000 Subject: [PATCH 29/29] line --- src/status_im/contexts/shell/share/wallet/view.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/status_im/contexts/shell/share/wallet/view.cljs b/src/status_im/contexts/shell/share/wallet/view.cljs index dfb137e2c53..43856d031dd 100644 --- a/src/status_im/contexts/shell/share/wallet/view.cljs +++ b/src/status_im/contexts/shell/share/wallet/view.cljs @@ -29,7 +29,6 @@ :message address :isNewTask true}))) - (defn- open-preferences [selected-networks] (rf/dispatch [:show-bottom-sheet