background color

This commit is contained in:
Roman Volosovskyi 2016-05-06 14:30:34 +03:00
parent 319bb656ec
commit 9548dd23ee
2 changed files with 21 additions and 25 deletions

View File

@ -54,6 +54,6 @@
;; load commands from remote server (todo: uncomment) ;; load commands from remote server (todo: uncomment)
;; (dispatch [:load-commands]) ;; (dispatch [:load-commands])
(dispatch [:init-console-chat]) (dispatch [:init-console-chat])
#_(dispatch [:init-chat]) (dispatch [:init-chat])
#_(init-back-button-handler!) (init-back-button-handler!)
#_(.registerComponent app-registry "SyngIm" #(r/reactify-component app-root))) (.registerComponent app-registry "SyngIm" #(r/reactify-component app-root)))

View File

@ -192,7 +192,6 @@
[view {:style {:paddingRight 16}} [view {:style {:paddingRight 16}}
[view {:style (merge {:borderRadius 14 [view {:style (merge {:borderRadius 14
:padding 12 :padding 12
:paddingRight 28
:backgroundColor color-white})} :backgroundColor color-white})}
(when (and group-chat (not outgoing)) (when (and group-chat (not outgoing))
[text {:style (merge style-sub-text [text {:style (merge style-sub-text
@ -259,15 +258,17 @@
(defn message-view (defn message-view
[{:keys [content-type outgoing background-color group-chat selected]} content] [{:keys [content-type outgoing background-color group-chat selected]} content]
[view {:style (merge {:borderRadius 14 [view {:style (merge {:borderRadius 14
:padding 12} :padding 12
:backgroundColor color-white}
(when (= content-type content-type-command)
{:paddingTop 10
:paddingBottom 14})
(if outgoing (if outgoing
(if (and group-chat (= content-type text-content-type)) (when (and group-chat (= content-type text-content-type))
{:backgroundColor color-blue} {:backgroundColor color-blue})
{:backgroundColor color-white}) (when selected
(if selected {:backgroundColor selected-message-color})))}
{:backgroundColor selected-message-color}
{:backgroundColor background-color})))}
#_(when (and group-chat (not outgoing)) #_(when (and group-chat (not outgoing))
[text {:style {:marginTop 0 [text {:style {:marginTop 0
:fontSize 12 :fontSize 12
@ -283,17 +284,14 @@
[wrapper message [message-content-command-request message]]) [wrapper message [message-content-command-request message]])
(defn text-message (defn text-message
[{:keys [content outgoing text-color group-chat] :as message}] [{:keys [content outgoing group-chat] :as message}]
[message-view message [message-view message
[text {:style {:marginTop (if (and group-chat (not outgoing)) [text {:style (merge style-message-text
4 {:marginTop (if (and group-chat (not outgoing))
0) 4
:fontSize 14 0)}
:fontFamily font (when (and outgoing group-chat)
:color (cond {:color color-white}))}
(and outgoing group-chat) color-white
outgoing text1-color
:else text-color)}}
content]]) content]])
(defmethod message-content text-content-type (defmethod message-content text-content-type
@ -302,9 +300,7 @@
(defmethod message-content content-type-status (defmethod message-content content-type-status
[_ message] [_ message]
;; todo should it be rendered as text message? [message-content-status message])
[message-content-status message]
#_[text-message message])
(defmethod message-content content-type-command (defmethod message-content content-type-command
[wrapper {:keys [content] :as message}] [wrapper {:keys [content] :as message}]