File tree 3 files changed +56
-1
lines changed
src/status_im/contexts/profile/contact
3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change
1
+ (ns status-im.contexts.profile.contact.contact-request.style )
2
+
3
+ (def message-prompt-wrapper
4
+ {:padding-top 4
5
+ :padding-bottom 8
6
+ :padding-horizontal 20 })
7
+
8
+ (def message-input-wrapper
9
+ {:padding-vertical 8
10
+ :padding-horizontal 20 })
Original file line number Diff line number Diff line change
1
+ (ns status-im.contexts.profile.contact.contact-request.view
2
+ (:require [clojure.string :as string]
3
+ [quo.core :as quo]
4
+ [react-native.core :as rn]
5
+ [status-im.contexts.profile.contact.contact-request.style :as style]
6
+ [utils.i18n :as i18n]
7
+ [utils.re-frame :as rf]))
8
+
9
+ (defn view
10
+ [{:keys [full-name profile-picture customization-color public-key]}]
11
+ (let [[message set-message] (rn/use-state " " )
12
+ on-message-change (rn/use-callback #(set-message %))
13
+ on-message-submit (rn/use-callback (fn []
14
+ (rf/dispatch [:hide-bottom-sheet ])
15
+ (rf/dispatch [:contact.ui/send-contact-request
16
+ public-key message]))
17
+ [public-key message])]
18
+ [:<>
19
+ [quo/drawer-top
20
+ {:type :context-tag
21
+ :context-tag-type :default
22
+ :title (i18n/label :t/send-contact-request )
23
+ :full-name full-name
24
+ :profile-picture profile-picture
25
+ :customization-color customization-color}]
26
+ [rn/text {:style style/message-prompt-wrapper}
27
+ (i18n/label :t/contact-request-message-prompt )]
28
+ [rn/view {:style style/message-input-wrapper}
29
+ [quo/input
30
+ {:type :text
31
+ :multiline? true
32
+ :char-limit 280
33
+ :label (i18n/label :t/message )
34
+ :on-change-text on-message-change}]]
35
+ [quo/bottom-actions
36
+ {:actions :one-action
37
+ :button-one-props {:disabled? (string/blank? message)
38
+ :on-press on-message-submit}
39
+ :button-one-label (i18n/label :t/send-contact-request )}]]))
Original file line number Diff line number Diff line change 5
5
[react-native.core :as rn]
6
6
[status-im.common.not-implemented]
7
7
[status-im.common.scalable-avatar.view :as avatar]
8
+ [status-im.contexts.profile.contact.contact-request.view :as contact-request]
8
9
[status-im.contexts.profile.contact.header.style :as style]
9
10
[status-im.contexts.profile.utils :as profile.utils]
10
11
[utils.i18n :as i18n]
36
37
:emoji-dash emoji-hash}]
37
38
[rn/view {:style style/button-wrapper}
38
39
[quo/button
39
- {:on-press status-im.common.not-implemented/alert
40
+ {:on-press #(rf/dispatch [:show-bottom-sheet
41
+ {:content (fn [] [contact-request/view
42
+ {:customization-color customization-color
43
+ :profile-picture profile-picture
44
+ :full-name full-name
45
+ :public-key public-key}])}])
40
46
:icon-left :i/add-user }
41
47
(i18n/label :t/send-contact-request )]]]))
You can’t perform that action at this time.
0 commit comments