[14429] Fix mentions (#14442)

This commit is contained in:
Ibrahem Khalil 2022-11-25 15:04:15 +02:00 committed by GitHub
parent 9de4417f03
commit 3d71fdba98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -172,21 +172,21 @@
:on-selection-change (partial on-selection-change timeout-id last-text-change mentionable-users)
:on-change (partial on-change last-text-change timeout-id mentionable-users refs chat-id sending-image)
:on-text-input (partial on-text-input mentionable-users chat-id)}
input-with-mentions (<sub [:chat/input-with-mentions])
children (fn []
(if mentions-enabled
(for [[index [type text]] (map-indexed
(fn [idx item]
[idx item])
(<sub [:chat/input-with-mentions]))]
^{:key (str index "_" type "_" text)}
[rn/text (when (= type :mention) {:style {:color colors/primary-50}})
text])
(map-indexed
(fn [index [item text]]
[index [item]]
^{:key (str index "_" type "_" text)}
[rn/text (when (= type :mention) {:style {:color colors/primary-50}})
text]) input-with-mentions)
(get @input-texts chat-id)))]
;when ios implementation for selectable-text-input is ready, we need remove this condition and use selectable-text-input directly.
(if platform/android?
[selectable-text-input chat-id props children]
[rn/text-input props
[children]])))
children])))
(defn selectable-text-input-manager []
(when (exists? (.-NativeModules react-native))