Skip to content

Commit

Permalink
refactor preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed Aug 31, 2023
1 parent da2a74b commit b76faf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/quo2/components/wallet/account_origin/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
[{:keys [type stored profile-picture user-name theme secondary-color]}]
(let [stored-name (if (= :on-device stored)
(i18n/label :t/on-device)
(i18n/label :t/on-device))]
(i18n/label :t/on-keycard))]
[row-view
{:type type
:stored stored
Expand Down
28 changes: 5 additions & 23 deletions src/status_im2/contexts/quo_preview/wallet/account_origin.cljs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
(ns status-im2.contexts.quo-preview.wallet.account-origin
(:require [quo2.core :as quo]
[react-native.core :as rn]
[quo2.foundations.colors :as colors]
[reagent.core :as reagent]
[status-im2.contexts.quo-preview.preview :as preview]
[status-im2.common.resources :as resources]))
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]))

(def descriptor
[{:type :select
Expand All @@ -17,7 +15,7 @@
:options [{:key :on-device}
{:key :on-keycard}]}])

(defn cool-preview
(defn view
[]
(let [state (reagent/atom {:type :default-keypair
:stored :on-keycard
Expand All @@ -26,21 +24,5 @@
:user-name "Alisher Yakupov"
:on-press #(js/alert "pressed")})]
(fn []
[rn/view
[rn/view {:style {:flex 1}}
[preview/customizer state descriptor]]
[rn/view
{:style {:padding-vertical 10
:margin-horizontal 20}}
[quo/account-origin @state]]])))

(defn view
[]
[rn/view
{:style {:background-color (colors/theme-colors colors/white colors/neutral-90)
:flex 1}}
[rn/flat-list
{:style {:flex 1}
:keyboard-should-persist-taps :always
:header [cool-preview]
:key-fn str}]])
[preview/preview-container {:state state :descriptor descriptor}
[quo/account-origin @state]])))

0 comments on commit b76faf8

Please sign in to comment.