From 185bee8a9c3836233317d2cc1110466fbab60e77 Mon Sep 17 00:00:00 2001 From: virvar Date: Tue, 7 Jun 2016 11:43:39 +0300 Subject: [PATCH] Show response input on icon click instead of message click Former-commit-id: c68d43dcaed048299c75bb3b4dea9a486a9ecdfd --- src/status_im/chat/styles/message.cljs | 15 +++++++------ src/status_im/chat/views/message.cljs | 29 +++++++++++++------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/status_im/chat/styles/message.cljs b/src/status_im/chat/styles/message.cljs index 5708d023a6..e87614f23b 100644 --- a/src/status_im/chat/styles/message.cljs +++ b/src/status_im/chat/styles/message.cljs @@ -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)}) diff --git a/src/status_im/chat/views/message.cljs b/src/status_im/chat/views/message.cljs index ceb430fc76..74611ddf2d 100644 --- a/src/status_im/chat/views/message.cljs +++ b/src/status_im/chat/views/message.cljs @@ -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]