From b2709cfd41f1f6d79b9070066b513f527b284131 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 5 Dec 2023 10:04:10 +0400 Subject: [PATCH] review --- .clj-kondo/rewrite-clj/rewrite-clj/config.edn | 5 +++ .../contexts/wallet/common/temp.cljs | 5 ++- .../backup_recovery_phrase/view.cljs | 40 ++++++++++--------- 3 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 .clj-kondo/rewrite-clj/rewrite-clj/config.edn diff --git a/.clj-kondo/rewrite-clj/rewrite-clj/config.edn b/.clj-kondo/rewrite-clj/rewrite-clj/config.edn new file mode 100644 index 000000000000..19ecae96a0ff --- /dev/null +++ b/.clj-kondo/rewrite-clj/rewrite-clj/config.edn @@ -0,0 +1,5 @@ +{: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/src/status_im2/contexts/wallet/common/temp.cljs b/src/status_im2/contexts/wallet/common/temp.cljs index d0b587d4b759..691e159a1646 100644 --- a/src/status_im2/contexts/wallet/common/temp.cljs +++ b/src/status_im2/contexts/wallet/common/temp.cljs @@ -108,5 +108,6 @@ :state :default :customization-color :blue}]) -(def secret-phrase ["witch" "collapse" "practice" "feed" "shame" "open" "lion" - "collapse" "umbrella" "fabric" "sadness" "obligue"]) +(def secret-phrase + ["witch" "collapse" "practice" "feed" "shame" "open" "lion" + "collapse" "umbrella" "fabric" "sadness" "obligue"]) diff --git a/src/status_im2/contexts/wallet/create_account/backup_recovery_phrase/view.cljs b/src/status_im2/contexts/wallet/create_account/backup_recovery_phrase/view.cljs index a2edb6e46860..f02f5e9a6e93 100644 --- a/src/status_im2/contexts/wallet/create_account/backup_recovery_phrase/view.cljs +++ b/src/status_im2/contexts/wallet/create_account/backup_recovery_phrase/view.cljs @@ -4,41 +4,45 @@ [react-native.blur :as blur] [react-native.core :as rn] [reagent.core :as reagent] + [status-im2.contexts.wallet.common.temp :as temp] [status-im2.contexts.wallet.create-account.backup-recovery-phrase.style :as style] [utils.i18n :as i18n] - [utils.re-frame :as rf] - [status-im2.contexts.wallet.common.temp :as temp])) + [utils.re-frame :as rf])) -(defn word-item +(defn- word-item [item index _ increment] [rn/view {:style style/word-item} [quo/counter {:type :grey} (+ index increment)] [quo/text {:style {:margin-left 4}} item]]) -(defn words-column - [words first?] +(defn- words-column + [words first-half?] [rn/flat-list {:style {:padding-vertical 8} - :data (if first? (subvec words 0 6) (subvec words 6)) + :data (if first-half? (subvec words 0 6) (subvec words 6)) :separator [rn/view {:style {:height 12}}] :render-fn word-item - :render-data (if first? 1 7) + :render-data (if first-half? 1 7) :scroll-enabled false}]) -(defn step-item - [item index _ checked] +(defn- step-item + [item index _ checked?] [rn/view {:style style/step-item} [quo/selectors {:type :checkbox - :on-change #(swap! checked assoc (keyword (str index)) %)}] + :on-change #(swap! checked? assoc (keyword (str index)) %)}] [quo/text {:style {:margin-left 12}} (i18n/label item)]]) (defn- view-internal [{:keys [theme]}] - (let [steps [:t/backup-step-1 :t/backup-step-2 :t/backup-step-3 - :t/backup-step-4] - checked (reagent/atom {:0 false :1 false :2 false :3 false}) - revealed? (reagent/atom false) + (let [step-labels [:t/backup-step-1 :t/backup-step-2 :t/backup-step-3 + :t/backup-step-4] + checked? (reagent/atom + {:0 false + :1 false + :2 false + :3 false}) + revealed? (reagent/atom false) {:keys [customization-color]} (rf/sub [:profile/profile])] (fn [] [rn/view {:style {:flex 1}} @@ -65,15 +69,15 @@ {:weight :semi-bold :style {:margin-bottom 8}} (i18n/label :t/how-to-backup)] [rn/flat-list - {:data steps + {:data step-labels :render-fn step-item - :render-data checked + :render-data checked? :scroll-enabled false}]]) (if @revealed? [rn/view {:style style/slide-button} [quo/bottom-actions {:button-one-label (i18n/label :t/i-have-written) - :button-one-props {:disabled? (some false? (vals @checked)) + :button-one-props {:disabled? (some false? (vals @checked?)) :customization-color customization-color :on-press #(js/alert "To be implemented")}}] [quo/text @@ -82,7 +86,7 @@ (i18n/label :t/next-you-will)]] [quo/bottom-actions {:button-one-label (i18n/label :t/reveal-phrase) - :button-one-props {:disabled? (some false? (vals @checked)) + :button-one-props {:disabled? (some false? (vals @checked?)) :customization-color customization-color :on-press #(reset! revealed? true)} :container-style style/slide-button}])])))