react switch warnings fix

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
Andrey Shovkoplyas 2019-04-23 11:52:32 +02:00 committed by yenda
parent 3134d1dfce
commit 0d2be79452
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
3 changed files with 5 additions and 5 deletions

View File

@ -145,7 +145,7 @@
[react/text {:style (assoc (styles/adv-settings-row-text colors/black)
:font-size 14)}
(i18n/label :t/logging-enabled)]
[react/switch {:on-tint-color colors/blue
[react/switch {:track-color #js {:true colors/blue :false nil}
:value logging-enabled
:on-value-change #(re-frame/dispatch [:log-level.ui/logging-enabled (not logging-enabled)])}]]
[react/view {:style (styles/adv-settings-row false)}
@ -217,7 +217,7 @@
[react/text {:style styles/adv-settings-subtitle} (i18n/label :t/pfs)]
[react/view {:style (styles/profile-row false)}
[react/text {:style (styles/profile-row-text colors/black)} (i18n/label :t/pfs)]
[react/switch {:on-tint-color colors/blue
[react/switch {:track-color #js {:true colors/blue :false nil}
:value pfs?
:on-value-change #(re-frame/dispatch [:accounts.ui/toggle-pfs (not pfs?)])}]]])))
@ -292,7 +292,7 @@
[share-contact-code]
[react/view {:style (styles/profile-row false)}
[react/text {:style (styles/profile-row-text colors/black)} (i18n/label :notifications)]
[react/switch {:on-tint-color colors/blue
[react/switch {:track-color #js {:true colors/blue :false nil}
:value notifications?
:on-value-change #(re-frame/dispatch [:accounts.ui/notifications-enabled (not notifications?)])}]]
[advanced-settings-item adv-settings-open?]

View File

@ -140,7 +140,7 @@
;; Replacing therefore with checkbox until I have more time to investigate
(checkbox.views/checkbox {:checked? enabled?
:on-value-change (partial toggle-enabled! installation-id enabled?)})
[react/switch {:on-tint-color colors/blue
[react/switch {:track-color #js {:true colors/blue :false nil}
:value enabled?
:on-value-change (partial toggle-enabled! installation-id enabled?)}])]]])

View File

@ -109,7 +109,7 @@
[react/view styles/settings-item
[react/view styles/settings-item-text-wrapper
[react/i18n-text {:style styles/settings-item-text :key label-kw}]]
[react/switch {:on-tint-color colors/blue
[react/switch {:track-color #js {:true colors/blue :false nil}
:value (boolean value)
:on-value-change action-fn
:disabled (not active?)}]])