Show response input on icon click instead of message click

Former-commit-id: c68d43dcae
This commit is contained in:
virvar 2016-06-07 11:43:39 +03:00
parent f2b1a1ae7a
commit 185bee8a9c
2 changed files with 24 additions and 20 deletions

View File

@ -137,12 +137,15 @@
(def command-request-from-text
(merge style-sub-text {:marginBottom 2}))
(defn command-request-image-view
[command]
{:position :absolute
:top 12
:right 0
:width 32
(def command-request-image-touchable
{:position :absolute
:top 12
:right 0
:width 32
:height 32})
(defn command-request-image-view [command]
{:width 32
:height 32
:borderRadius 50
:backgroundColor (:color command)})

View File

@ -82,22 +82,23 @@
(fn [{:keys [msg-id content from incoming-group]}]
(let [commands @commands-atom
{:keys [command content]} (parse-command-request commands content)]
[touchable-highlight {:onPress #(set-chat-command msg-id command)
:accessibility-label (label command)}
[view st/comand-request-view
[view st/command-request-message-view
(when incoming-group
[text {:style st/command-request-from-text}
from])
[text {:style st/style-message-text}
content]]
[view st/comand-request-view
[view st/command-request-message-view
(when incoming-group
[text {:style st/command-request-from-text}
from])
[text {:style st/style-message-text}
content]]
[touchable-highlight {:style st/command-request-image-touchable
:onPress #(set-chat-command msg-id command)
:accessibility-label (label command)}
[view (st/command-request-image-view command)
[image {:source (:request-icon command)
:style st/command-request-image}]]
(when (:request-text command)
[view st/command-request-text-view
[text {:style st/style-sub-text}
(:request-text command)]])]]))))
:style st/command-request-image}]]]
(when (:request-text command)
[view st/command-request-text-view
[text {:style st/style-sub-text}
(:request-text command)]])]))))
(defn message-view
[message content]