Skip to content

Commit 802d9c0

Browse files
committed
tidy: subscribe to contact data inside contact-request view
1 parent 913963f commit 802d9c0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/status_im/contexts/profile/contact/contact_request/view.cljs

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
[quo.core :as quo]
44
[react-native.core :as rn]
55
[status-im.contexts.profile.contact.contact-request.style :as style]
6+
[status-im.contexts.profile.utils :as profile.utils]
67
[utils.i18n :as i18n]
78
[utils.re-frame :as rf]))
89

910
(defn view
10-
[{:keys [full-name profile-picture customization-color public-key]}]
11-
(let [[message set-message] (rn/use-state "")
11+
[]
12+
(let [{:keys [public-key customization-color]
13+
:as profile} (rf/sub [:contacts/current-contact])
14+
;; TODO: remove :blue when #18733 merged.
15+
customization-color (or customization-color :blue)
16+
full-name (profile.utils/displayed-name profile)
17+
profile-picture (profile.utils/photo profile)
18+
[message set-message] (rn/use-state "")
1219
on-message-change (rn/use-callback #(set-message %))
1320
on-message-submit (rn/use-callback (fn []
1421
(rf/dispatch [:hide-bottom-sheet])

src/status_im/contexts/profile/contact/header/view.cljs

+1-5
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
[rn/view {:style style/button-wrapper}
3939
[quo/button
4040
{: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}])}])
41+
{:content (fn [] [contact-request/view])}])
4642
:icon-left :i/add-user}
4743
(i18n/label :t/send-contact-request)]]]))

0 commit comments

Comments
 (0)