-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Icon added to disclaimer component (#20309)
- Loading branch information
Showing
6 changed files
with
61 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,7 @@ | |
|
||
(def text | ||
{:margin-left 8}) | ||
|
||
(def icon-container | ||
{:align-items :flex-end | ||
:flex 1}) |
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
37 changes: 26 additions & 11 deletions
37
src/status_im/contexts/preview/quo/selectors/disclaimer.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,33 +1,48 @@ | ||
(ns status-im.contexts.preview.quo.selectors.disclaimer | ||
(:require | ||
[quo.core :as quo] | ||
[quo.theme :as quo.theme] | ||
[react-native.core :as rn] | ||
[reagent.core :as reagent] | ||
[status-im.contexts.preview.quo.preview :as preview])) | ||
|
||
(def descriptor | ||
[{:key :checked? :type :boolean} | ||
{:key :blur? :type :boolean} | ||
{:key :text :type :text}]) | ||
{:key :text :type :text} | ||
{:key :icon :type :boolean} | ||
(preview/customization-color-option)]) | ||
|
||
(defn view | ||
[] | ||
(let [state (reagent/atom {:checked? false | ||
:blur? true | ||
:text "I agree with the community rules"})] | ||
(let [state (reagent/atom {:checked? false | ||
:blur? false | ||
:text "I agree with the community rules" | ||
:icon false | ||
:customization-color :blue})] | ||
(fn [] | ||
(let [{:keys [blur? checked? text]} @state] | ||
(let [{:keys [blur? checked? text icon customization-color]} @state | ||
theme (quo.theme/use-theme) | ||
blur? (if (= :light theme) false blur?)] | ||
[preview/preview-container | ||
{:state state | ||
:descriptor descriptor | ||
:descriptor (if (= :light theme) | ||
descriptor | ||
(vec (conj descriptor {:key :blur? :type :boolean}))) | ||
:blur? blur? | ||
:show-blur-background? true | ||
:component-container-style {:padding 20}} | ||
[rn/view {:style {:margin-bottom 20}} | ||
[quo/disclaimer | ||
{:blur? blur? | ||
:checked? checked? | ||
:on-change #(swap! state update :checked? not)} | ||
{:blur? blur? | ||
:checked? checked? | ||
:icon (when icon | ||
(if checked? | ||
:i/locked | ||
:i/unlocked)) | ||
:on-change #(swap! state update :checked? not) | ||
:customization-color customization-color} | ||
text]] | ||
[quo/button {:disabled? (not checked?)} | ||
[quo/button | ||
{:disabled? (not checked?) | ||
:customization-color customization-color} | ||
"submit"]])))) |