-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement reviewal of contact requests from contact profile #19119
Merged
seanstrom
merged 10 commits into
develop
from
seanstrom/contact-profile-contact-request-received
Mar 11, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2af6032
chore: add english translation for contact-request-review
seanstrom a8d11cd
feature: integrate contact-request-review button
seanstrom 2dccea4
tweak: render the locked-input label when provided
seanstrom e650a55
tweak: allow locked-input component to grow in height
seanstrom 67bfa0e
chore: add english translation for "ignore"
seanstrom dc927c0
feature: add subscription for retrieving a pending contact-request by…
seanstrom ef780e3
feature: integrate initial contact request review flow
seanstrom 9bb1490
tweak: display send-message button on contact profile when contact-re…
seanstrom 26b4df1
tidy: refactor button-wrapper view to be button container-styles
seanstrom c625ee3
feature: add toast for accepting contact request
seanstrom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/status_im/contexts/profile/contact/contact_review/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns status-im.contexts.profile.contact.contact-review.style) | ||
|
||
(def message-input-wrapper | ||
{:padding-vertical 8 | ||
:padding-horizontal 20}) | ||
|
||
(def bottom-actions-wrapper | ||
{:padding-vertical 4}) |
52 changes: 52 additions & 0 deletions
52
src/status_im/contexts/profile/contact/contact_review/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(ns status-im.contexts.profile.contact.contact-review.view | ||
(:require [quo.core :as quo] | ||
[react-native.core :as rn] | ||
[status-im.contexts.profile.contact.contact-review.style :as style] | ||
[status-im.contexts.profile.utils :as profile.utils] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn view | ||
[] | ||
(let [{:keys [public-key customization-color] | ||
:as profile} (rf/sub [:contacts/current-contact]) | ||
{contact-request-id :id | ||
:keys [message]} (rf/sub [:activity-center/pending-contact-request-from-contact-id | ||
public-key]) | ||
;; TODO(@seanstrom): https://github.com/status-im/status-mobile/issues/18733 | ||
customization-color (or customization-color :blue) | ||
full-name (profile.utils/displayed-name profile) | ||
profile-picture (profile.utils/photo profile) | ||
on-contact-accept (rn/use-callback | ||
(fn [] | ||
(rf/dispatch [:hide-bottom-sheet]) | ||
(rf/dispatch [:activity-center.contact-requests/accept | ||
contact-request-id]) | ||
(rf/dispatch [:toasts/upsert | ||
{:id :accept-contact-request | ||
:type :positive | ||
:text (i18n/label | ||
:t/contact-request-was-accepted)}])) | ||
[contact-request-id]) | ||
on-contact-ignore (rn/use-callback (fn [] | ||
(rf/dispatch [:hide-bottom-sheet])))] | ||
[:<> | ||
[quo/drawer-top | ||
{:type :context-tag | ||
:context-tag-type :default | ||
:title (i18n/label :t/contact-request-review) | ||
:full-name full-name | ||
:profile-picture profile-picture | ||
:customization-color customization-color}] | ||
[rn/view {:style style/message-input-wrapper} | ||
[quo/locked-input {} | ||
(-> message :content :text)]] | ||
[rn/view {:style style/bottom-actions-wrapper} | ||
[quo/bottom-actions | ||
{:actions :two-actions | ||
:button-one-label (i18n/label :t/accept) | ||
:button-one-props {:type :positive | ||
:on-press on-contact-accept} | ||
:button-two-props {:type :danger | ||
:on-press on-contact-ignore} | ||
:button-two-label (i18n/label :t/ignore)}]]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 End of file whitespace is being added by formatter