selectin color changed for selectable text inputs and texts (#5469)

This commit is contained in:
Volodymyr Kozieiev 2018-08-14 15:45:37 +03:00 committed by GitHub
parent 879e33b9b5
commit 6cdb1ac629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 25 deletions

View File

@ -10,7 +10,8 @@
[status-im.ui.screens.add-new.new-public-chat.view :refer [default-public-chats]]
[status-im.ui.screens.add-new.new-public-chat.db :as public-chat-db]
[taoensso.timbre :as log]
[status-im.ui.components.react :as react]))
[status-im.ui.components.react :as react]
[status-im.ui.components.colors :as colors]))
(views/defview new-contact []
(views/letsubs [new-contact-identity [:get :contacts/new-identity]
@ -29,13 +30,14 @@
[react/text {:style styles/new-contact-subtitle} (i18n/label :contact-code)]
[react/view {:style styles/new-contact-separator}]
[react/view {:style styles/add-contact-edit-view}
[react/text-input {:placeholder "0x..."
:flex 1
:style styles/add-contact-input
:on-change (fn [e]
(let [native-event (.-nativeEvent e)
text (.-text native-event)]
(re-frame/dispatch [:set :contacts/new-identity text])))}]
[react/text-input {:placeholder "0x..."
:flex 1
:style styles/add-contact-input
:selection-color colors/hawkes-blue
:on-change (fn [e]
(let [native-event (.-nativeEvent e)
text (.-text native-event)]
(re-frame/dispatch [:set :contacts/new-identity text])))}]
[react/touchable-highlight {:disabled chat-error :on-press #(when-not chat-error (re-frame/dispatch [:add-contact-handler new-contact-identity]))}
[react/view
{:style (styles/add-contact-button chat-error)}
@ -64,17 +66,18 @@
[react/view {:style styles/new-contact-separator}]
[react/view {:style styles/add-contact-edit-view}
[react/view {:style {:flex 1}}
[react/text-input {:flex 1
:ref #(when (and (nil? @topic-input-ref) %)
(.setNativeProps % (js-obj "text" "#"))
(reset! topic-input-ref %))
:style styles/add-contact-input
:on-change (fn [e]
(let [native-event (.-nativeEvent e)
text (.-text native-event)
[_ before after] (first (re-seq #"(.*)\#(.*)" text))]
(.setNativeProps @topic-input-ref (js-obj "text" (str "#" before after)))
(re-frame/dispatch [:set :public-group-topic (subs text 1)])))}]]
[react/text-input {:flex 1
:ref #(when (and (nil? @topic-input-ref) %)
(.setNativeProps % (js-obj "text" "#"))
(reset! topic-input-ref %))
:style styles/add-contact-input
:selection-color colors/hawkes-blue
:on-change (fn [e]
(let [native-event (.-nativeEvent e)
text (.-text native-event)
[_ before after] (first (re-seq #"(.*)\#(.*)" text))]
(.setNativeProps @topic-input-ref (js-obj "text" (str "#" before after)))
(re-frame/dispatch [:set :public-group-topic (subs text 1)])))}]]
[react/touchable-highlight {:disabled topic-error
:on-press #(when-not topic-error
(do

View File

@ -69,11 +69,12 @@
photo-path)}
:style styles/photo-style}]])))
(views/defview message-with-timestamp [text {:keys [timestamp] :as message} style]
(views/defview message-with-timestamp [text {:keys [timestamp outgoing] :as message} style]
[react/view {:style style}
[react/view {:style styles/message-wrapper}
[react/text {:style styles/message-text
:selectable true}
[react/text {:style (styles/message-text message)
:selectable true
:selection-color (if outgoing colors/white colors/hawkes-blue)}
text]
[react/text {:style (styles/message-timestamp-placeholder)}
(time/timestamp->time timestamp)]
@ -217,5 +218,6 @@
[react/text {:style (styles/contact-card-text colors/blue)}
(i18n/label :t/send-message)]]]
[react/text {:style styles/chat-profile-contact-code} (i18n/label :t/contact-code)]
[react/text {:style {:font-size 14}
:selectable true} public-key]]]))
[react/text {:style {:font-size 14}
:selectable true
:selection-color colors/hawkes-blue} public-key]]]))

View File

@ -42,7 +42,9 @@
[react/view {:style styles/qr-code}
[qr-code-viewer/qr-code {:value public-key :size 130}]]
[react/view {:style {:align-items :center}}
[react/text {:style styles/qr-code-text}
[react/text {:style styles/qr-code-text
:selectable true
:selection-color colors/hawkes-blue}
public-key]
(when tooltip-opacity
[copied-tooltip tooltip-opacity])]