This commit is contained in:
virvar 2016-05-09 17:33:41 +03:00
parent 03d719edaf
commit 4e7bdd4742
3 changed files with 22 additions and 19 deletions

View File

@ -214,9 +214,9 @@
subtitle])]]])
(defn actions-list-view []
(let [{:keys [group-chat active]}
(subscribe [:chat-properties [:group-chat :name :contacts :active]])]
(when-let [actions (when (and @group-chat @active)
(let [{:keys [group-chat chat-id]}
(subscribe [:chat-properties [:group-chat :chat-id]])]
(when-let [actions (if @group-chat
[{:title "Add Contact to chat"
:icon :icon_menu_group
:icon-style {:width 25
@ -241,12 +241,12 @@
:icon :icon_settings
:icon-style {:width 20
:height 13}
:handler (fn [])}]
[{:title "Profile"
:icon "icon_menu_group"
:icon-style {:width 25
:height 19}
:handler #(dispatch [:show-profile navigator (:chat-id chat)])}])]
:handler (fn [])}]
[{:title "Profile"
:icon "icon_menu_group"
:icon-style {:width 25
:height 19}
:handler #(dispatch [:show-profile @chat-id])}])]
[view {:style {:backgroundColor toolbar-background1
:elevation 2
:position :absolute

View File

@ -34,9 +34,9 @@
(let [message-atom (subscribe [:get-chat-command-content])]
(fn [command input-options & {:keys [validator]}]
(let [message @message-atom]
[view {:style {:flexDirection "column"}}
[view {:style {:flexDirection :column}}
[content-suggestions-view]
[view {:style {:flexDirection "row"
[view {:style {:flexDirection :row
:height 56
:backgroundColor color-white
:elevation 4}}
@ -65,11 +65,13 @@
:placeholder "Type"
:placeholderTextColor text2-color
:onChangeText set-input-message
:onSubmitEditing send-command}
input-options)
message]
(if (valid? message validator)
[touchable-highlight
:onSubmitEditing (fn []
(when (valid? message validator)
(send-command)))}
input-options)
message]
(if (valid? message validator)
[touchable-highlight
{:on-press send-command
:underlay-color :transparent}
[view {:style {:marginTop 10

View File

@ -451,10 +451,10 @@
(contacts/load-syng-contacts db)))
(register-handler :show-profile
(fn [db [action navigator identity]]
(fn [db [action identity]]
(log/debug action)
(let [db (contacts/set-contact-identity db identity)]
(dispatch [:navigate-to navigator {:view-id :profile} :push])
(dispatch [:navigate-to :profile])
db)))
;; -- Chats --------------------------------------------------------------
@ -465,7 +465,8 @@
(let [db (-> db
(create-chat chat-id [chat-id] false)
(set-current-chat-id chat-id))]
(dispatch [:navigate-to navigator {:view-id :chat} nav-type])
;; (dispatch [:navigate-to navigator {:view-id :chat} nav-type])
(dispatch [:navigate-to :chat])
db)))
(register-handler :init-console-chat