From 152407b9036e5e9349a1909e921eeb4783119e75 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Tue, 25 May 2021 13:15:53 +0200 Subject: [PATCH] [Fixes: #12060] Highlight posts that mention you Signed-off-by: Andrea Maria Piana --- src/status_im/ui/components/colors.cljs | 37 ++++++++++++------- .../ui/screens/chat/message/message.cljs | 23 ++++++------ .../screens/chat/styles/message/message.cljs | 5 ++- status-go-version.json | 6 +-- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/status_im/ui/components/colors.cljs b/src/status_im/ui/components/colors.cljs index ee5a77b1da..8960dbe50a 100644 --- a/src/status_im/ui/components/colors.cljs +++ b/src/status_im/ui/components/colors.cljs @@ -9,21 +9,25 @@ b (js/parseInt (subs hex 4 6) 16)] (str "rgba(" r "," g "," b "," opacity ")"))) -(def dark {:white "#141414" - :black "#ffffff" - :gray-lighter "#252528" - :blue "#6177E5" - :gray "#838C91" - :blue-light "#23252F" - :red "#FC5F5F"}) +(def dark {:white "#141414" + :black "#ffffff" + :gray-lighter "#252528" + :mentioned-background "#2a4046" + :mentioned-border "#2a4046" + :blue "#6177E5" + :gray "#838C91" + :blue-light "#23252F" + :red "#FC5F5F"}) -(def light {:white "#ffffff" - :black "#000000" - :gray-lighter "#eef2f5" - :blue "#4360df" - :gray "#939ba1" - :blue-light "#ECEFFC" - :red "#ff2d55"}) +(def light {:white "#ffffff" + :black "#000000" + :gray-lighter "#eef2f5" + :blue "#4360df" + :gray "#939ba1" + :mentioned-background "#def6fc" + :mentioned-border "#b8ecf9" + :blue-light "#ECEFFC" + :red "#ff2d55"}) (def themes {:dark dark :light light}) @@ -36,6 +40,9 @@ (def white-transparent-70 (alpha white 0.7)) (def white-transparent-70-persist (alpha white 0.7)) +(def mentioned-background (:mentioned-background light)) +(def mentioned-border (:mentioned-border light)) + (def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow needed ;; BLACK @@ -116,6 +123,8 @@ (set! blue-light (:blue-light colors)) (set! red (:red colors)) (set! text black) + (set! mentioned-background (:mentioned-background colors)) + (set! mentioned-border (:mentioned-border colors)) (set! white-transparent-10 (alpha white 0.1)) (set! white-transparent (alpha white 0.4)) (set! white-transparent-70 (alpha white 0.7)) diff --git a/src/status_im/ui/screens/chat/message/message.cljs b/src/status_im/ui/screens/chat/message/message.cljs index 0bed871ef3..94c74da7a8 100644 --- a/src/status_im/ui/screens/chat/message/message.cljs +++ b/src/status_im/ui/screens/chat/message/message.cljs @@ -342,7 +342,7 @@ (get content :parsed-text))) :label (i18n/label :t/sharing-copy-to-clipboard)}]))) -(defn collapsible-text-message [_ _] +(defn collapsible-text-message [{:keys [mentioned]} _] (let [collapsed? (reagent/atom false) collapsible? (reagent/atom false)] (fn [{:keys [content outgoing current-public-key public?] :as message} on-long-press modal] @@ -377,16 +377,17 @@ [message-timestamp message true]) (when (and @collapsible? (not modal)) (if @collapsed? - [react/touchable-highlight - {:on-press #(swap! collapsed? not) - :style {:position :absolute :bottom 0 :left 0 :right 0 :height 72}} - [react/linear-gradient {:colors [(str colors/blue-light "00") colors/blue-light] - :start {:x 0 :y 0} :end {:x 0 :y 0.9}} - [react/view {:height 72 :align-self :center :justify-content :flex-end - :padding-bottom 10} - [react/view (style/collapse-button) - [icons/icon :main-icons/dropdown - {:color colors/white}]]]]] + (let [color (if mentioned colors/mentioned-background colors/blue-light)] + [react/touchable-highlight + {:on-press #(swap! collapsed? not) + :style {:position :absolute :bottom 0 :left 0 :right 0 :height 72}} + [react/linear-gradient {:colors [(str color "00") color] + :start {:x 0 :y 0} :end {:x 0 :y 0.9}} + [react/view {:height 72 :align-self :center :justify-content :flex-end + :padding-bottom 10} + [react/view (style/collapse-button) + [icons/icon :main-icons/dropdown + {:color colors/white}]]]]]) [react/touchable-highlight {:on-press #(swap! collapsed? not) :style {:align-self :center :margin 5}} [react/view (style/collapse-button) diff --git a/src/status_im/ui/screens/chat/styles/message/message.cljs b/src/status_im/ui/screens/chat/styles/message/message.cljs index 9f3e929ab9..4066e0a93e 100644 --- a/src/status_im/ui/screens/chat/styles/message/message.cljs +++ b/src/status_im/ui/screens/chat/styles/message/message.cljs @@ -115,7 +115,7 @@ :shadow-offset {:width 0 :height 4}}) (defn message-view - [{:keys [content-type outgoing group-chat last-in-group?]}] + [{:keys [content-type outgoing group-chat last-in-group? mentioned]}] (merge {:border-top-left-radius 16 :border-top-right-radius 16 @@ -136,6 +136,9 @@ (cond (= content-type constants/content-type-system-text) nil outgoing {:background-color colors/blue} + mentioned {:background-color colors/mentioned-background + :border-color colors/mentioned-border + :border-width 1} :else {:background-color colors/blue-light}) (when (= content-type constants/content-type-emoji) diff --git a/status-go-version.json b/status-go-version.json index 80365e3d1c..86968ea8f6 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -2,7 +2,7 @@ "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh ' instead", "owner": "status-im", "repo": "status-go", - "version": "v0.79.4", - "commit-sha1": "d1dc5f1e272b72d84a8c6bee1fe09de6c7d6fd1e", - "src-sha256": "04nszlhn33p0szqpd115h50gcgw3jm3yjrvqv028ry1zzn4r8k6a" + "version": "v0.79.5", + "commit-sha1": "dfd46680879954fed29f18863354139d3d2ff34b", + "src-sha256": "0v5v32zvazcr1fnv8j08pknwz7567i6brhyr51x42al1an9jdkqj" }