background color

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

View File

@ -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)))

View File

@ -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
@ -260,14 +259,16 @@
(defn message-view
[{:keys [content-type outgoing background-color group-chat selected]} content]
[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 (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))
[text {:style (merge style-message-text
{: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)}}
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}]