tweak: test sharing a state-sub

This commit is contained in:
Sean Hagstrom 2024-03-30 14:45:41 +00:00 committed by Icaro Motta
parent c3a62f080b
commit 541e51b37b
No known key found for this signature in database
GPG Key ID: 009557D9D014DF07

View File

@ -148,11 +148,12 @@
on-message-change (rn/use-callback #(do on-message-change (rn/use-callback #(do
(rf/dispatch-sync [:ui/set-contact-request-message public-key %]) (rf/dispatch-sync [:ui/set-contact-request-message public-key %])
(set-message %))) (set-message %)))
bind-sub (use-bind-sub state-sub (combine-subs {:message message-sub
(combine-subs {:message message-sub :public-key (reagent.ratom/cursor
:public-key (reagent.ratom/cursor profile-sub
profile-sub [:public-key])})
[:public-key])})) bind-sub (use-bind-sub state-sub)
bind-sub-alt (use-bind-sub state-sub)
bind-state (use-bind-state {:public-key public-key bind-state (use-bind-state {:public-key public-key
:message message})] :message message})]
(rn/use-unmount (rn/use-unmount
@ -197,7 +198,7 @@
:button-one-props {:disabled? (string/blank? message) :button-one-props {:disabled? (string/blank? message)
:accessibility-label :send-contact-request :accessibility-label :send-contact-request
:customization-color customization-color :customization-color customization-color
:on-press (bind-state on-message-submit)} :on-press (bind-sub-alt on-message-submit)}
:button-one-label "Test Button One" :button-one-label "Test Button One"
:button-two-props {:accessibility-label :test-button :button-two-props {:accessibility-label :test-button
:customization-color :danger :customization-color :danger