Skip to content

Commit ef88c00

Browse files
committed
tweak: hide contact-request button if contact-request is already sent
1 parent b407a3a commit ef88c00

File tree

1 file changed

+13
-6
lines changed
  • src/status_im/contexts/profile/contact/header

1 file changed

+13
-6
lines changed

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

+13-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[react-native.core :as rn]
66
[status-im.common.not-implemented]
77
[status-im.common.scalable-avatar.view :as avatar]
8+
[status-im.constants :as constants]
89
[status-im.contexts.profile.contact.contact-request.view :as contact-request]
910
[status-im.contexts.profile.contact.header.style :as style]
1011
[status-im.contexts.profile.utils :as profile.utils]
@@ -14,7 +15,7 @@
1415
(defn view
1516
[{:keys [scroll-y]}]
1617
(let [{:keys [public-key customization-color
17-
emoji-hash bio]
18+
emoji-hash bio contact-request-state]
1819
:as profile} (rf/sub [:contacts/current-contact])
1920
customization-color (or customization-color :blue)
2021
full-name (profile.utils/displayed-name profile)
@@ -37,8 +38,14 @@
3738
:description :text
3839
:description-text bio
3940
:emoji-dash emoji-hash}]
40-
[rn/view {:style style/button-wrapper}
41-
[quo/button
42-
{:on-press on-contact-request
43-
:icon-left :i/add-user}
44-
(i18n/label :t/send-contact-request)]]]))
41+
42+
(cond
43+
(or (not contact-request-state)
44+
(= contact-request-state constants/contact-request-state-none))
45+
[rn/view {:style style/button-wrapper}
46+
[quo/button
47+
{:on-press on-contact-request
48+
:icon-left :i/add-user}
49+
(i18n/label :t/send-contact-request)]]
50+
51+
:else nil)]))

0 commit comments

Comments
 (0)