Skip to content

Commit

Permalink
refactor preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed Aug 1, 2023
1 parent 70d31e0 commit cf71c5b
Showing 1 changed file with 30 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,47 @@
[reagent.core :as reagent]
[status-im2.contexts.quo-preview.preview :as preview]))


(def descriptor
[{:label "Blur:"
:key :blur?
:type :boolean}
{:label "Disable:"
:key :disabled?
:type :boolean}])
:type :boolean}
{:label "Type"
:type :select
:key :type
:options [{:key :digit
:value "Digit"}
{:key :key
:value "Key"}
{:key :derivation-path
:value "Derivation Path"}]}])

(defn cool-preview
[]
(let [state (reagent/atom {:disabled? false
:on-press #(js/alert "pressed")
:blur? false})]
:on-press #(js/alert "pressed" %)
:blur? false
:type :digit})]
(fn []
[rn/view {:style {:padding-bottom 150}}
[rn/view {:style {:flex 1}}
[preview/customizer state descriptor]]
[preview/blur-view
{:style {:flex 1
:margin-horizontal 20}
:show-blur-background? (:blur? @state)
:blur-view-props (when (:blur? @state)
{:overlay-color colors/neutral-80-opa-80})}
[rn/view
{:style {:flex-direction :row
:width 220
:padding 20
:justify-content :space-between
:flex 1}}
[quo/keyboard-key (assoc @state :type :digit) 1]
[quo/keyboard-key (assoc @state :type :key) :i/delete]
[quo/keyboard-key (assoc @state :type :derivation-path)]]]])))
(let [value (case (:type @state)
:key :i/delete
:derivation-path nil
:digit 1
nil)]
[rn/view {:style {:padding-bottom 150}}
[rn/view {:style {:flex 1}}
[preview/customizer state descriptor]]
[preview/blur-view
{:style {:flex 1
:align-self :center
:justify-self :center
:margin-horizontal 20}
:show-blur-background? (:blur? @state)
:blur-view-props (when (:blur? @state)
{:overlay-color colors/neutral-80-opa-80})}
[quo/keyboard-key @state value]]]))))

(defn preview-keyboard-key
[]
Expand Down

0 comments on commit cf71c5b

Please sign in to comment.