From f0695f41c8bc20339658d2df48aa7a51a1f52fca Mon Sep 17 00:00:00 2001 From: tumanov-alex Date: Tue, 31 Oct 2023 18:51:57 +0100 Subject: [PATCH] Provide global customization color to buttons --- .../wallet/address_add_edit/views.cljs | 3 ++- .../contexts/wallet/address_watch/view.cljs | 22 ++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/status_im/ui/screens/wallet/address_add_edit/views.cljs b/src/status_im/ui/screens/wallet/address_add_edit/views.cljs index c339b9fa4d55..5ffa4edee7e2 100644 --- a/src/status_im/ui/screens/wallet/address_add_edit/views.cljs +++ b/src/status_im/ui/screens/wallet/address_add_edit/views.cljs @@ -16,9 +16,10 @@ (defn- view-internal [] (let [{:keys [accounts-count address]} (rf/sub [:get-screen-params]) + {:keys [customization-color]} (rf/sub [:profile/multiaccount]) account-name (reagent/atom (str "Account " accounts-count)) address-title (i18n/label :t/watch-address) - account-color (reagent/atom :purple) + account-color (reagent/atom customization-color) account-emoji (reagent/atom (emoji-picker.utils/random-emoji)) on-change-name #(reset! account-name %) on-change-color #(reset! account-color %) diff --git a/src/status_im2/contexts/wallet/address_watch/view.cljs b/src/status_im2/contexts/wallet/address_watch/view.cljs index e813c85e5457..e48f4562918b 100644 --- a/src/status_im2/contexts/wallet/address_watch/view.cljs +++ b/src/status_im2/contexts/wallet/address_watch/view.cljs @@ -14,10 +14,11 @@ (defn view-internal [] - (let [top (safe-area/get-top) - bottom (safe-area/get-bottom) - input-value (reagent/atom "") - {:keys [accounts-count]} (rf/sub [:get-screen-params])] + (let [top (safe-area/get-top) + bottom (safe-area/get-bottom) + input-value (reagent/atom "") + {:keys [accounts-count]} (rf/sub [:get-screen-params]) + {:keys [customization-color]} (rf/sub [:profile/multiaccount])] (fn [] [rn/view {:style {:flex 1 @@ -45,11 +46,12 @@ {:icon-only? true :type :outline} :i/scan]] [quo/button - {:disabled? (clojure.string/blank? @input-value) - :on-press #(re-frame/dispatch [:navigate-to - :address-to-watch-edit - {:accounts-count accounts-count - :address @input-value}]) - :container-style (style/button-container bottom)} (i18n/label :t/continue)]]))) + {:customization-color customization-color + :disabled? (clojure.string/blank? @input-value) + :on-press #(re-frame/dispatch [:navigate-to + :address-to-watch-edit + {:accounts-count accounts-count + :address @input-value}]) + :container-style (style/button-container bottom)} (i18n/label :t/continue)]]))) (def view (quo.theme/with-theme view-internal))