From f44813fb57807e521cab9995aaadd02266f656a1 Mon Sep 17 00:00:00 2001 From: alwx Date: Tue, 25 Jun 2024 13:41:07 +0200 Subject: [PATCH] Post-review fixes --- .../common/raw_data_block/style.cljs | 5 +-- src/status_im/common/raw_data_block/view.cljs | 4 +- .../modals/common/data_block/view.cljs | 6 +-- .../modals/common/footer/view.cljs | 10 ++--- .../modals/common/header/view.cljs | 2 +- .../wallet_connect/modals/common/style.cljs | 4 ++ .../modals/send_transaction/view.cljs | 6 +-- .../modals/sign_message/view.cljs | 8 ++-- .../modals/sign_transaction/view.cljs | 37 +++++++++---------- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/status_im/common/raw_data_block/style.cljs b/src/status_im/common/raw_data_block/style.cljs index 35dc5a5f7c..bd0c94dcb6 100644 --- a/src/status_im/common/raw_data_block/style.cljs +++ b/src/status_im/common/raw_data_block/style.cljs @@ -1,12 +1,11 @@ (ns status-im.common.raw-data-block.style (:require [quo.foundations.colors :as colors])) -(defn container - [bottom-margin?] +(def container {:flex 1 :padding 10 :margin-top 10.5 - :margin-bottom (when bottom-margin? 10.5) + :margin-bottom 0 :border-width 1 :border-color colors/neutral-10 :border-radius 16}) diff --git a/src/status_im/common/raw_data_block/view.cljs b/src/status_im/common/raw_data_block/view.cljs index e08ac2cd5b..ec99ecf73d 100644 --- a/src/status_im/common/raw_data_block/view.cljs +++ b/src/status_im/common/raw_data_block/view.cljs @@ -4,9 +4,9 @@ [status-im.common.raw-data-block.style :as style])) (defn view - [{:keys [data bottom-margin?] :or {bottom-margin? true}}] + [data] [rn/scroll-view - {:style (style/container bottom-margin?) + {:style style/container :content-container-style style/content} [quo/text {:size :paragraph-2 diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/common/data_block/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/common/data_block/view.cljs index 1c5e762d49..eb2ce66499 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/common/data_block/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/common/data_block/view.cljs @@ -2,9 +2,7 @@ (:require [status-im.common.raw-data-block.view :as raw-data-block] [utils.re-frame :as rf])) -(defn data-block +(defn view [] (let [display-data (rf/sub [:wallet-connect/current-request-display-data])] - [raw-data-block/view - {:data display-data - :bottom-margin? false}])) + [raw-data-block/view display-data])) diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/common/footer/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/common/footer/view.cljs index 4ccc5560ff..4d422c1bf9 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/common/footer/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/common/footer/view.cljs @@ -12,13 +12,13 @@ (rf/dispatch [:hide-bottom-sheet]) (rf/dispatch [:wallet-connect/respond-current-session password])) -(defn footer - [{:keys [warning-label slide-button-text disabed?]} children] +(defn view + [{:keys [warning-label slide-button-text disabed?]} & children] (let [{:keys [customization-color]} (rf/sub [:wallet-connect/current-request-account-details])] [rn/view {:style style/content-container} - [rn/view - {:style style/data-items-container} - children] + (into [rn/view + {:style style/data-items-container}] + children) [rn/view {:style style/auth-container} [standard-authentication/slide-button {:size :size-48 diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/common/header/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/common/header/view.cljs index a256d60dec..991949fcaa 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/common/header/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/common/header/view.cljs @@ -3,7 +3,7 @@ [react-native.core :as rn] [status-im.contexts.wallet.wallet-connect.modals.common.header.style :as style])) -(defn header +(defn view [{:keys [label dapp account]}] [rn/view {:style style/header-container} diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/common/style.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/common/style.cljs index c2c56dbc80..d120b68d35 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/common/style.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/common/style.cljs @@ -14,6 +14,10 @@ {:flex 1 :padding-horizontal 20}) +(def sign-message-content-container + (merge data-content-container + {:margin-bottom 10.5})) + (def data-item {:flex 1 :background-color :transparent}) diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/send_transaction/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/send_transaction/view.cljs index 66a7f4fc6e..8d15f99f88 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/send_transaction/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/send_transaction/view.cljs @@ -27,11 +27,11 @@ :accessibility-label :wallet-connect-sign-message-close}] [rn/view {:flex 1} [rn/view {:style style/data-content-container} - [header/header + [header/view {:label (i18n/label :t/wallet-connect-send-transaction-header) :dapp dapp :account account}] - [data-block/data-block]] + [data-block/view]] (when error-state [quo/alert-banner {:action? false @@ -41,7 +41,7 @@ :not-enough-assets :t/not-enough-assets))}]) - [footer/footer + [footer/view {:warning-label (i18n/label :t/wallet-connect-send-transaction-warning) :slide-button-text (i18n/label :t/slide-to-send) :disabled? error-state} diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/sign_message/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/sign_message/view.cljs index d64826cc5e..ac631677ef 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/sign_message/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/sign_message/view.cljs @@ -23,13 +23,13 @@ :on-press #(rf/dispatch [:navigate-back]) :accessibility-label :wallet-connect-sign-message-close}] [rn/view {:flex 1} - [rn/view {:style style/data-content-container} - [header/header + [rn/view {:style style/sign-message-content-container} + [header/view {:label (i18n/label :t/wallet-connect-sign-message-header) :dapp dapp :account account}] - [data-block/data-block]] - [footer/footer + [data-block/view]] + [footer/view {:warning-label (i18n/label :t/wallet-connect-sign-message-warning) :slide-button-text (i18n/label :t/slide-to-sign)} [quo/data-item diff --git a/src/status_im/contexts/wallet/wallet_connect/modals/sign_transaction/view.cljs b/src/status_im/contexts/wallet/wallet_connect/modals/sign_transaction/view.cljs index 8bd6ef624b..15f54467b2 100644 --- a/src/status_im/contexts/wallet/wallet_connect/modals/sign_transaction/view.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/modals/sign_transaction/view.cljs @@ -27,11 +27,11 @@ :accessibility-label :wallet-connect-sign-message-close}] [rn/view {:flex 1} [rn/view {:style style/data-content-container} - [header/header + [header/view {:label (i18n/label :t/wallet-connect-sign-transaction-header) :dapp dapp :account account}] - [data-block/data-block]] + [data-block/view]] (when error-state [quo/alert-banner {:action? false @@ -41,24 +41,23 @@ :not-enough-assets :t/not-enough-assets))}]) - [footer/footer + [footer/view {:warning-label (i18n/label :t/wallet-connect-sign-transaction-warning) :slide-button-text (i18n/label :t/slide-to-sign) :disabled? error-state} - [:<> - [quo/data-item - {:status :default - :card? false - :container-style style/data-item - :title (i18n/label :t/network) - :subtitle-type :network - :network-image (:source network) - :subtitle (:full-name network)}] - [quo/data-item - {:size :small - :status :default - :card? false - :container-style style/data-item - :title (i18n/label :t/max-fees) - :subtitle (or max-fees-fiat-formatted (i18n/label :t/no-fees))}]]]]])) + [quo/data-item + {:status :default + :card? false + :container-style style/data-item + :title (i18n/label :t/network) + :subtitle-type :network + :network-image (:source network) + :subtitle (:full-name network)}] + [quo/data-item + {:size :small + :status :default + :card? false + :container-style style/data-item + :title (i18n/label :t/max-fees) + :subtitle (or max-fees-fiat-formatted (i18n/label :t/no-fees))}]]]]))