diff --git a/src/status_im/contexts/chat/messenger/messages/contact_requests/bottom_drawer/view.cljs b/src/status_im/contexts/chat/messenger/messages/contact_requests/bottom_drawer/view.cljs index 76bbe93b5e..d3e3488f6b 100644 --- a/src/status_im/contexts/chat/messenger/messages/contact_requests/bottom_drawer/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/contact_requests/bottom_drawer/view.cljs @@ -16,8 +16,13 @@ contact-id]) {:keys [contact-request-state community-id]} (rf/sub [:chats/current-chat-chat-view]) chat-type (rf/sub [:chats/chat-type]) - joined (rf/sub [:communities/community-joined - community-id]) + community-chat? (= chat-type :community-chat) + joined (when community-chat? + (rf/sub [:communities/community-joined + community-id])) + pending? (when community-chat? + (rf/sub [:communities/my-pending-request-to-join + community-id])) contact-request-send? (or (not contact-request-state) (= contact-request-state constants/contact-request-state-none)) @@ -28,19 +33,28 @@ [rn/view {:style style/container} [quo/permission-context {:blur? true - :on-press (condp = chat-type - :community-chat #(rf/dispatch [:open-modal :community-account-selection-sheet - {:community-id community-id}]) + :on-press (cond + (and community-chat? (not pending?) (not joined)) + #(rf/dispatch [:open-modal :community-account-selection-sheet + {:community-id community-id}]) + + (not community-chat?) #(rf/dispatch [:chat.ui/show-profile contact-id])) :type :action :action-icon (cond - (= chat-type :community-chat) :i/communities - contact-request-pending? :i/pending-state - :else :i/add-user) + community-chat? :i/communities + contact-request-pending? :i/pending-state + :else :i/add-user) :action-label (cond - (= chat-type :community-chat) - (if joined + community-chat? + (cond + pending? + (i18n/label :t/request-to-join-community-pending) + + joined (i18n/label :t/no-permissions-to-post) + + :else (i18n/label :t/join-community-to-post)) (= chat-type :group-chat) diff --git a/src/status_im/navigation/transitions.cljs b/src/status_im/navigation/transitions.cljs index af79ce4194..b4ef5790c5 100644 --- a/src/status_im/navigation/transitions.cljs +++ b/src/status_im/navigation/transitions.cljs @@ -44,15 +44,15 @@ (def stack-slide-transition {:push {:content {:translationX {:from (:width (rn/get-window)) :to 0 - :duration 200}}} + :duration 250}}} :pop {:content {:translationX {:from 0 :to (:width (rn/get-window)) - :duration 200}}}}) + :duration 250}}}}) (def stack-transition-from-bottom {:push {:content {:translationY {:from (:height (rn/get-window)) :to 0 - :duration 200}}} + :duration 250}}} :pop {:content {:translationY {:from 0 :to (:height (rn/get-window)) - :duration 200}}}}) + :duration 250}}}}) diff --git a/translations/en.json b/translations/en.json index 9181607396..49e5a90dc8 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1276,6 +1276,7 @@ "request-to-join-disclaimer": "Joining the community will reveal your public addresses to the owner", "request-to-join": "Request to join", "request-to-join-community": "Request to join community", + "request-to-join-community-pending": "Request to join community pending", "requested-to-join-community": "You requested to join “{{community}}”", "request-transaction": "Request transaction", "required-field": "Required field",