Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed Dec 5, 2023
1 parent 846eef1 commit b2709cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .clj-kondo/rewrite-clj/rewrite-clj/config.edn
Original file line number Diff line number Diff line change
@@ -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/->>}}
5 changes: 3 additions & 2 deletions src/status_im2/contexts/wallet/common/temp.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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
Expand All @@ -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}])])))
Expand Down

0 comments on commit b2709cf

Please sign in to comment.