Skip to content

Commit 23f9b9c

Browse files
committed
tidy: wrap callback with use-callback
1 parent c043244 commit 23f9b9c

File tree

1 file changed

+4
-3
lines changed
  • src/status_im/contexts/profile/contact/header

1 file changed

+4
-3
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
full-name (profile.utils/displayed-name profile)
2121
profile-picture (profile.utils/photo profile)
2222
online? (rf/sub [:visibility-status-updates/online? public-key])
23-
theme (quo.theme/use-theme-value)]
23+
theme (quo.theme/use-theme-value)
24+
on-contact-request (rn/use-callback #(rf/dispatch [:show-bottom-sheet
25+
{:content (fn [] [contact-request/view])}]))]
2426
[rn/view {:style style/header-container}
2527
[rn/view {:style style/avatar-wrapper}
2628
[avatar/view
@@ -37,7 +39,6 @@
3739
:emoji-dash emoji-hash}]
3840
[rn/view {:style style/button-wrapper}
3941
[quo/button
40-
{:on-press #(rf/dispatch [:show-bottom-sheet
41-
{:content (fn [] [contact-request/view])}])
42+
{:on-press on-contact-request
4243
:icon-left :i/add-user}
4344
(i18n/label :t/send-contact-request)]]]))

0 commit comments

Comments
 (0)