-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
648 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 12 additions & 34 deletions
46
src/status_im2/contexts/quo_preview/colors/color_picker.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,26 @@ | ||
(ns status-im2.contexts.quo-preview.colors.color-picker | ||
(:require [quo2.core :as quo] | ||
[quo2.foundations.colors :as colors] | ||
[react-native.blur :as blur] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent] | ||
[status-im2.contexts.quo-preview.preview :as preview])) | ||
|
||
(def descriptor | ||
[{:label "Color:" | ||
:key :color | ||
[{:key :selected | ||
:type :select | ||
:options (map (fn [color] | ||
(let [k (get color :name)] | ||
{:key k :value k})) | ||
(quo/picker-colors))} | ||
{:label "Blur?" | ||
:key :blur | ||
:type :boolean}]) | ||
{:key :blur? | ||
:type :boolean}]) | ||
|
||
(defn cool-preview | ||
(defn view | ||
[] | ||
(let [state (reagent/atom {:color "orange" :blur false}) | ||
blur (reagent/cursor state [:blur]) | ||
color (reagent/cursor state [:color])] | ||
(let [state (reagent/atom {:selected :orange | ||
:blur? false})] | ||
(fn [] | ||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!} | ||
[rn/view {:padding-bottom 150} | ||
[preview/customizer state descriptor] | ||
[(if @blur blur/view :<>) | ||
[rn/view {:padding-vertical 60 :align-items :center} | ||
[quo/color-picker | ||
{:blur? @blur | ||
:selected @color | ||
:on-change #(reset! color %)}]]]]]))) | ||
|
||
(defn preview-color-picker | ||
[] | ||
[rn/view | ||
{:background-color (colors/theme-colors | ||
colors/white | ||
colors/neutral-95) | ||
:flex 1} | ||
[rn/flat-list | ||
{:flex 1 | ||
:keyboard-should-persist-taps :always | ||
:header [cool-preview] | ||
:key-fn str}]]) | ||
[preview/preview-container | ||
{:state state | ||
:descriptor descriptor | ||
:blur? (:blur? @state) | ||
:show-blur-background? true} | ||
[quo/color-picker (assoc @state :on-change #(swap! state assoc :selected %))]]))) |
61 changes: 18 additions & 43 deletions
61
src/status_im2/contexts/quo_preview/dividers/divider_label.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,29 @@ | ||
(ns status-im2.contexts.quo-preview.dividers.divider-label | ||
(:require [quo2.components.dividers.divider-label :as divider-label] | ||
[quo2.foundations.colors :as colors] | ||
[react-native.core :as rn] | ||
(:require [quo2.core :as quo] | ||
[reagent.core :as reagent] | ||
[status-im2.contexts.quo-preview.preview :as preview])) | ||
|
||
(def descriptor | ||
[{:label "Label:" | ||
:key :label | ||
:type :text} | ||
{:label "Chevron position:" | ||
:key :chevron-position | ||
[{:type :text :key :label} | ||
{:type :text :key :counter-value} | ||
{:type :boolean :key :increase-padding-top?} | ||
{:type :boolean :key :blur?} | ||
{:key :chevron-position | ||
:type :select | ||
:options [{:key :left | ||
:value "Left"} | ||
{:key :right | ||
:value "Right"}]} | ||
{:label "Counter value:" | ||
:key :counter-value | ||
:type :text} | ||
{:label "Increase padding top:" | ||
:key :increase-padding-top? | ||
:type :boolean} | ||
{:label "Blur:" | ||
:key :blur? | ||
:type :boolean}]) | ||
:options [{:key :left} | ||
{:key :right}]}]) | ||
|
||
(defn cool-preview | ||
(defn view | ||
[] | ||
(let [state (reagent/atom {:label "Welcome" | ||
(let [state (reagent/atom {:blur? false | ||
:chevron-position :left | ||
:counter-value 0 | ||
:counter-value "0" | ||
:increase-padding-top? true | ||
:blur? false})] | ||
:label "Welcome"})] | ||
(fn [] | ||
[rn/touchable-without-feedback {:on-press rn/dismiss-keyboard!} | ||
[rn/view {:padding-bottom 150} | ||
[preview/customizer state descriptor] | ||
[rn/view {:padding-vertical 60} | ||
[divider-label/divider-label @state]]]]))) | ||
|
||
(defn preview-divider-label | ||
[] | ||
[rn/view | ||
{:background-color (colors/theme-colors | ||
colors/white | ||
colors/neutral-90) | ||
:flex 1} | ||
[rn/flat-list | ||
{:flex 1 | ||
:keyboard-should-persist-taps :always | ||
:header [cool-preview] | ||
:key-fn str}]]) | ||
[preview/preview-container | ||
{:state state | ||
:descriptor descriptor | ||
:blur? (:blur? @state) | ||
:show-blur-background? true} | ||
[quo/divider-label @state]]))) |
Oops, something went wrong.