fix the mention highlighted area is only updated after reopening the chat (#19076)

This commit is contained in:
Parvesh Monu 2024-03-05 21:06:22 +05:30 committed by GitHub
parent f788d7bc85
commit 613e48ece3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 15 deletions

View File

@ -14,18 +14,18 @@
(defn mention-tag-wrapper (defn mention-tag-wrapper
[first-child-mention] [first-child-mention]
{:flex-direction :row {:flex-direction :row
:align-items :center :align-items :center
:height (if platform/ios? 22 21) :height (if platform/ios? 22 21)
:background-color colors/primary-50-opa-10 :border-radius 6
:padding-horizontal 3 :transform [{:translateY (if platform/ios? (if first-child-mention 4.5 3) 4.5)}]})
:border-radius 6
:transform [{:translateY (if platform/ios? (if first-child-mention 4.5 3) 4.5)}]})
(def mention-tag-text (def mention-tag-text
{:color (colors/theme-colors colors/primary-50 {:color (colors/theme-colors colors/primary-50
colors/primary-60) colors/primary-60)
:selection-color :transparent :selection-color :transparent
:background-color colors/primary-50-opa-10
:padding-horizontal 3
:suppress-highlighting true}) :suppress-highlighting true})
(defn code (defn code

View File

@ -56,14 +56,16 @@
:mention :mention
(conj (conj
units units
[rn/pressable (let [resolved-mention (rf/sub [:messages/resolve-mention literal])]
{:on-press #(rf/dispatch [:chat.ui/show-profile literal]) [rn/pressable
:style (style/mention-tag-wrapper first-child-mention)} {:on-press #(rf/dispatch [:chat.ui/show-profile literal])
[quo/text :key resolved-mention
{:weight :medium :style (style/mention-tag-wrapper first-child-mention)}
:style style/mention-tag-text [quo/text
:size :paragraph-1} {:weight :medium
(rf/sub [:messages/resolve-mention literal])]]) :style style/mention-tag-text
:size :paragraph-1}
resolved-mention]]))
:edited :edited
(conj units (conj units