'Message' button on profile view

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

View File

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

View File

@ -107,7 +107,12 @@
(r/sorted :name :asc)))) (r/sorted :name :asc))))
(defn contact-by-identity [identity] (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))))
;;;;;;;;;;;;;;;;;;;;---------------------------------------------- ;;;;;;;;;;;;;;;;;;;;----------------------------------------------