Skip to content

Commit

Permalink
Show correct drawer message for pending community request (#20485)
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull authored Jun 21, 2024
1 parent b5a09a3 commit 5ee5d70
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/status_im/navigation/transitions.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}}})
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5ee5d70

Please sign in to comment.