Skip to content

Commit 7b35e13

Browse files
committed
tidy: wrap callback with use-callback
1 parent 95ae9e7 commit 7b35e13

File tree

1 file changed

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

1 file changed

+4
-3
lines changed

Diff for: src/status_im/contexts/profile/contact/header/view.cljs

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
full-name (profile.utils/displayed-name profile)
2222
profile-picture (profile.utils/photo profile)
2323
online? (rf/sub [:visibility-status-updates/online? public-key])
24-
theme (quo.theme/use-theme-value)]
24+
theme (quo.theme/use-theme-value)
25+
on-contact-request (rn/use-callback #(rf/dispatch [:show-bottom-sheet
26+
{:content (fn [] [contact-request/view])}]))]
2527
[rn/view {:style style/header-container}
2628
[rn/view {:style style/header-top-wrapper}
2729
[rn/view {:style style/avatar-wrapper}
@@ -45,7 +47,6 @@
4547
:emoji-dash emoji-hash}]
4648
[rn/view {:style style/button-wrapper}
4749
[quo/button
48-
{:on-press #(rf/dispatch [:show-bottom-sheet
49-
{:content (fn [] [contact-request/view])}])
50+
{:on-press on-contact-request
5051
:icon-left :i/add-user}
5152
(i18n/label :t/send-contact-request)]]]))

0 commit comments

Comments
 (0)