[Fixes: #12060] Highlight posts that mention you

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2021-05-25 13:15:53 +02:00
parent e30ca97184
commit 152407b903
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
4 changed files with 42 additions and 29 deletions

View File

@ -12,6 +12,8 @@
(def dark {:white "#141414" (def dark {:white "#141414"
:black "#ffffff" :black "#ffffff"
:gray-lighter "#252528" :gray-lighter "#252528"
:mentioned-background "#2a4046"
:mentioned-border "#2a4046"
:blue "#6177E5" :blue "#6177E5"
:gray "#838C91" :gray "#838C91"
:blue-light "#23252F" :blue-light "#23252F"
@ -22,6 +24,8 @@
:gray-lighter "#eef2f5" :gray-lighter "#eef2f5"
:blue "#4360df" :blue "#4360df"
:gray "#939ba1" :gray "#939ba1"
:mentioned-background "#def6fc"
:mentioned-border "#b8ecf9"
:blue-light "#ECEFFC" :blue-light "#ECEFFC"
:red "#ff2d55"}) :red "#ff2d55"})
@ -36,6 +40,9 @@
(def white-transparent-70 (alpha white 0.7)) (def white-transparent-70 (alpha white 0.7))
(def white-transparent-70-persist (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 (def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow needed
;; BLACK ;; BLACK
@ -116,6 +123,8 @@
(set! blue-light (:blue-light colors)) (set! blue-light (:blue-light colors))
(set! red (:red colors)) (set! red (:red colors))
(set! text black) (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-10 (alpha white 0.1))
(set! white-transparent (alpha white 0.4)) (set! white-transparent (alpha white 0.4))
(set! white-transparent-70 (alpha white 0.7)) (set! white-transparent-70 (alpha white 0.7))

View File

@ -342,7 +342,7 @@
(get content :parsed-text))) (get content :parsed-text)))
:label (i18n/label :t/sharing-copy-to-clipboard)}]))) :label (i18n/label :t/sharing-copy-to-clipboard)}])))
(defn collapsible-text-message [_ _] (defn collapsible-text-message [{:keys [mentioned]} _]
(let [collapsed? (reagent/atom false) (let [collapsed? (reagent/atom false)
collapsible? (reagent/atom false)] collapsible? (reagent/atom false)]
(fn [{:keys [content outgoing current-public-key public?] :as message} on-long-press modal] (fn [{:keys [content outgoing current-public-key public?] :as message} on-long-press modal]
@ -377,16 +377,17 @@
[message-timestamp message true]) [message-timestamp message true])
(when (and @collapsible? (not modal)) (when (and @collapsible? (not modal))
(if @collapsed? (if @collapsed?
(let [color (if mentioned colors/mentioned-background colors/blue-light)]
[react/touchable-highlight [react/touchable-highlight
{:on-press #(swap! collapsed? not) {:on-press #(swap! collapsed? not)
:style {:position :absolute :bottom 0 :left 0 :right 0 :height 72}} :style {:position :absolute :bottom 0 :left 0 :right 0 :height 72}}
[react/linear-gradient {:colors [(str colors/blue-light "00") colors/blue-light] [react/linear-gradient {:colors [(str color "00") color]
:start {:x 0 :y 0} :end {:x 0 :y 0.9}} :start {:x 0 :y 0} :end {:x 0 :y 0.9}}
[react/view {:height 72 :align-self :center :justify-content :flex-end [react/view {:height 72 :align-self :center :justify-content :flex-end
:padding-bottom 10} :padding-bottom 10}
[react/view (style/collapse-button) [react/view (style/collapse-button)
[icons/icon :main-icons/dropdown [icons/icon :main-icons/dropdown
{:color colors/white}]]]]] {:color colors/white}]]]]])
[react/touchable-highlight {:on-press #(swap! collapsed? not) [react/touchable-highlight {:on-press #(swap! collapsed? not)
:style {:align-self :center :margin 5}} :style {:align-self :center :margin 5}}
[react/view (style/collapse-button) [react/view (style/collapse-button)

View File

@ -115,7 +115,7 @@
:shadow-offset {:width 0 :height 4}}) :shadow-offset {:width 0 :height 4}})
(defn message-view (defn message-view
[{:keys [content-type outgoing group-chat last-in-group?]}] [{:keys [content-type outgoing group-chat last-in-group? mentioned]}]
(merge (merge
{:border-top-left-radius 16 {:border-top-left-radius 16
:border-top-right-radius 16 :border-top-right-radius 16
@ -136,6 +136,9 @@
(cond (cond
(= content-type constants/content-type-system-text) nil (= content-type constants/content-type-system-text) nil
outgoing {:background-color colors/blue} 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}) :else {:background-color colors/blue-light})
(when (= content-type constants/content-type-emoji) (when (= content-type constants/content-type-emoji)

View File

@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead", "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im", "owner": "status-im",
"repo": "status-go", "repo": "status-go",
"version": "v0.79.4", "version": "v0.79.5",
"commit-sha1": "d1dc5f1e272b72d84a8c6bee1fe09de6c7d6fd1e", "commit-sha1": "dfd46680879954fed29f18863354139d3d2ff34b",
"src-sha256": "04nszlhn33p0szqpd115h50gcgw3jm3yjrvqv028ry1zzn4r8k6a" "src-sha256": "0v5v32zvazcr1fnv8j08pknwz7567i6brhyr51x42al1an9jdkqj"
} }