From ed5fc9a20d305c91435767757343764c62b4e67f Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 6 May 2016 14:30:34 +0300 Subject: [PATCH] background color Former-commit-id: 9548dd23eee058745b8685cd20248a124ef146f2 --- src/syng_im/android/core.cljs | 6 +-- src/syng_im/components/chat/chat_message.cljs | 40 +++++++++---------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/syng_im/android/core.cljs b/src/syng_im/android/core.cljs index 28085cad7c..a8cf5785f9 100644 --- a/src/syng_im/android/core.cljs +++ b/src/syng_im/android/core.cljs @@ -54,6 +54,6 @@ ;; load commands from remote server (todo: uncomment) ;; (dispatch [:load-commands]) (dispatch [:init-console-chat]) - #_(dispatch [:init-chat]) - #_(init-back-button-handler!) - #_(.registerComponent app-registry "SyngIm" #(r/reactify-component app-root))) + (dispatch [:init-chat]) + (init-back-button-handler!) + (.registerComponent app-registry "SyngIm" #(r/reactify-component app-root))) diff --git a/src/syng_im/components/chat/chat_message.cljs b/src/syng_im/components/chat/chat_message.cljs index 7b1b8a3726..726e55e249 100644 --- a/src/syng_im/components/chat/chat_message.cljs +++ b/src/syng_im/components/chat/chat_message.cljs @@ -192,7 +192,6 @@ [view {:style {:paddingRight 16}} [view {:style (merge {:borderRadius 14 :padding 12 - :paddingRight 28 :backgroundColor color-white})} (when (and group-chat (not outgoing)) [text {:style (merge style-sub-text @@ -259,15 +258,17 @@ (defn message-view [{:keys [content-type outgoing background-color group-chat selected]} content] - [view {:style (merge {:borderRadius 14 - :padding 12} + [view {:style (merge {:borderRadius 14 + :padding 12 + :backgroundColor color-white} + (when (= content-type content-type-command) + {:paddingTop 10 + :paddingBottom 14}) (if outgoing - (if (and group-chat (= content-type text-content-type)) - {:backgroundColor color-blue} - {:backgroundColor color-white}) - (if selected - {:backgroundColor selected-message-color} - {:backgroundColor background-color})))} + (when (and group-chat (= content-type text-content-type)) + {:backgroundColor color-blue}) + (when selected + {:backgroundColor selected-message-color})))} #_(when (and group-chat (not outgoing)) [text {:style {:marginTop 0 :fontSize 12 @@ -283,17 +284,14 @@ [wrapper message [message-content-command-request message]]) (defn text-message - [{:keys [content outgoing text-color group-chat] :as message}] + [{:keys [content outgoing group-chat] :as message}] [message-view message - [text {:style {:marginTop (if (and group-chat (not outgoing)) - 4 - 0) - :fontSize 14 - :fontFamily font - :color (cond - (and outgoing group-chat) color-white - outgoing text1-color - :else text-color)}} + [text {:style (merge style-message-text + {:marginTop (if (and group-chat (not outgoing)) + 4 + 0)} + (when (and outgoing group-chat) + {:color color-white}))} content]]) (defmethod message-content text-content-type @@ -302,9 +300,7 @@ (defmethod message-content content-type-status [_ message] - ;; todo should it be rendered as text message? - [message-content-status message] - #_[text-message message]) + [message-content-status message]) (defmethod message-content content-type-command [wrapper {:keys [content] :as message}]