File tree 1 file changed +11
-0
lines changed
src/status_im/contexts/profile/contact/contact_request
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2
2
(:require [clojure.string :as string]
3
3
[quo.core :as quo]
4
4
[react-native.core :as rn]
5
+ [react-native.platform :as platform]
5
6
[status-im.constants :as constants]
6
7
[status-im.contexts.profile.contact.contact-request.style :as style]
7
8
[status-im.contexts.profile.utils :as profile.utils]
16
17
customization-color (or customization-color constants/profile-default-color)
17
18
full-name (profile.utils/displayed-name profile)
18
19
profile-picture (profile.utils/photo profile)
20
+ input-ref (rn/use-ref-atom nil )
19
21
[message set-message] (rn/use-state " " )
20
22
on-message-change (rn/use-callback #(set-message %))
21
23
on-message-submit (rn/use-callback (fn []
28
30
:text (i18n/label
29
31
:t/contact-request-was-sent )}]))
30
32
[public-key message])]
33
+ (rn/use-mount
34
+ (fn []
35
+ (let [listener (.addListener rn/keyboard
36
+ " keyboardDidHide"
37
+ (fn [_event]
38
+ (when (and platform/android? @input-ref)
39
+ (.blur ^js @input-ref))))]
40
+ #(.remove ^js listener))))
31
41
[:<>
32
42
[quo/drawer-top
33
43
{:type :context-tag
41
51
[rn/view {:style style/message-input-wrapper}
42
52
[quo/input
43
53
{:type :text
54
+ :ref #(reset! input-ref %)
44
55
:multiline? true
45
56
:char-limit constants/contact-request-message-max-length
46
57
:max-length constants/contact-request-message-max-length
You can’t perform that action at this time.
0 commit comments