'Message' button on profile view

This commit is contained in:
virvar 2016-05-09 10:25:15 +03:00
parent 547c9031be
commit 252452f5b0
2 changed files with 12 additions and 4 deletions

View File

@ -34,6 +34,10 @@
[text {:style st/profile-property-view-value}
value]]])
(defn message-user [navigator identity]
(when identity
(dispatch [:show-chat identity navigator :push])))
(defn profile [{:keys [navigator]}]
(let [contact (subscribe [:contact])]
(fn [{:keys [navigator]}]
@ -54,9 +58,8 @@
[text {:style st/status}
"!not implemented"]
[view {:style st/btns-container}
[touchable-highlight {:onPress (fn []
;; TODO not implemented
)
[touchable-highlight {:onPress #(message-user navigator
(:whisper-identity @contact))
:underlay-color :transparent}
[view {:style st/message-btn}
[text {:style st/message-btn-text}

View File

@ -107,7 +107,12 @@
(r/sorted :name :asc))))
(defn contact-by-identity [identity]
(r/single-cljs (r/get-by-field :contacts :whisper-identity identity)))
(if (= identity "console")
{:phone-number ""
:whisper-identity "console"
:name "Console"
:photo-path ""}
(r/single-cljs (r/get-by-field :contacts :whisper-identity identity))))
;;;;;;;;;;;;;;;;;;;;----------------------------------------------