From 22bd2f1761deba99e7c5b2d47b4345474bcde1e4 Mon Sep 17 00:00:00 2001 From: bitsikka Date: Thu, 21 Mar 2019 23:45:03 +0545 Subject: [PATCH] [#7799] fix chat does not scroll if touch starts on top of datemark Signed-off-by: Igor Mandrigin --- src/status_im/ui/screens/chat/message/datemark.cljs | 12 ++++++++++++ .../ui/screens/chat/styles/message/datemark.cljs | 6 ++++++ src/status_im/ui/screens/chat/views.cljs | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/status_im/ui/screens/chat/message/datemark.cljs b/src/status_im/ui/screens/chat/message/datemark.cljs index b906c6de7d..c373a81902 100644 --- a/src/status_im/ui/screens/chat/message/datemark.cljs +++ b/src/status_im/ui/screens/chat/message/datemark.cljs @@ -1,5 +1,6 @@ (ns status-im.ui.screens.chat.message.datemark (:require [status-im.ui.components.react :as react] + [re-frame.core :as re-frame] [clojure.string :as string] [status-im.ui.screens.chat.styles.message.datemark :as style])) @@ -8,3 +9,14 @@ [react/view style/datemark [react/text {:style style/datemark-text} (string/capitalize value)]]]) + +(defn chat-datemark-mobile [value] + [react/touchable-without-feedback + {:on-press (fn [_] + (re-frame/dispatch + [:chat.ui/set-chat-ui-props {:messages-focused? true + :show-stickers? false}]) + (react/dismiss-keyboard!))} + [react/view style/datemark-mobile + [react/text {:style style/datemark-text} + (string/capitalize value)]]]) diff --git a/src/status_im/ui/screens/chat/styles/message/datemark.cljs b/src/status_im/ui/screens/chat/styles/message/datemark.cljs index a1d8a8e019..6c6d258a35 100644 --- a/src/status_im/ui/screens/chat/styles/message/datemark.cljs +++ b/src/status_im/ui/screens/chat/styles/message/datemark.cljs @@ -10,5 +10,11 @@ {:margin-top 16 :height 22}) +(def datemark-mobile + {:flex 1 + :align-items :center + :margin-top 16 + :height 22}) + (def datemark-text {:color colors/gray}) diff --git a/src/status_im/ui/screens/chat/views.cljs b/src/status_im/ui/screens/chat/views.cljs index eccbf676e2..0b0daadbbb 100644 --- a/src/status_im/ui/screens/chat/views.cljs +++ b/src/status_im/ui/screens/chat/views.cljs @@ -68,7 +68,7 @@ (defmethod message-row :datemark [{{:keys [value]} :row}] - [message-datemark/chat-datemark value]) + [message-datemark/chat-datemark-mobile value]) (defmethod message-row :default [{:keys [group-chat current-public-key modal? row]}]