Compare commits

..
6 Commits
Author SHA1 Message Date
Ibrahem Khalil 9d886a18e5 Merge branch 'develop' into 14620 2023-01-08 12:23:37 +02:00
Ibrahem Khalil 48cb50b8d5 Merge branch 'develop' into 14620 2022-12-30 20:39:58 +02:00
Ibrahem Khalil 70ca925144 Merge branch 'develop' into 14620 2022-12-28 19:13:29 +02:00
ibrkhalil 11961c37ad Clean 2022-12-28 19:12:46 +02:00
Ibrahem Khalil 98da40d28d Merge branch 'develop' into 14620 2022-12-26 18:21:53 +02:00
ibrahem 7abd425f91 Add spacing for cross button on Android 2022-12-26 12:43:50 +02:00
3 changed files with 18 additions and 14 deletions
+4 -3
View File
@@ -49,9 +49,10 @@
cursor (+ at-sign-idx (count name) 2)]
(rf/merge
cofx
{:db (-> db
(assoc-in [:chats/cursor chat-id] cursor)
(assoc-in [:chats/mention-suggestions chat-id] nil))}
{:db (-> db
(assoc-in [:chats/cursor chat-id] cursor)
(assoc-in [:chats/mention-suggestions chat-id] nil))
:set-text-input-value [chat-id new-text text-input-ref]}
(set-chat-input-text new-text chat-id)
;; NOTE(rasom): Some keyboards do not react on selection property passed to
;; text input (specifically Samsung keyboard with predictive text set on).
@@ -175,6 +175,7 @@
:editable (not cooldown-enabled?)
:blur-on-submit false
:auto-focus false
:default-value initial-value
:on-focus #(set-active-panel nil)
:max-length chat.constants/max-text-size
:placeholder-text-color (:text-02 @quo.colors/theme)
@@ -194,14 +195,15 @@
(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 (rf/sub [:chat/input-with-mentions])
children (if mentions-enabled?
(map-indexed
(fn [index [type text]]
^{:key (str index "_" type "_" text)}
[rn/text (when (= type :mention) {:style {:color colors/primary-50}})
text])
input-with-mentions)
(get @input-texts chat-id))]
children (fn []
(if mentions-enabled?
(map-indexed
(fn [index [_ text]]
^{:key (str index "_" type "_" text)}
[rn/text (when (= type :mention) {:style {:color colors/primary-50}})
text])
input-with-mentions)
(get @input-texts chat-id)))]
(reset! text-input-ref (:text-input-ref refs))
;when ios implementation for selectable-text-input is ready, we need remove this condition and use
;selectable-text-input directly.
@@ -222,7 +224,8 @@
(defn update-input-text
[{:keys [text-input chat-id]} text]
(on-text-change text chat-id))
(on-text-change text chat-id)
(.setNativeProps ^js text-input (clj->js {:text text})))
(re-frame/reg-fx
:set-text-input-value
@@ -335,7 +338,7 @@
(oops/ocall manager :startActionMode text-input-handle))))
:reagent-render
(fn [chat-id {:keys [style ref on-selection-change] :as props} children]
(fn [_]
(let [ref #(do (reset! text-input-ref %)
(when ref
(quo.react/set-ref-val! ref %)))
@@ -94,7 +94,7 @@
:border-radius 7
:background-color colors/neutral-50
:position :absolute
:top -7
:top (if platform/android? 0 -7)
:right -7
:justify-content :center
:align-items :center})