-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: ReportUserModal #4051
feat: ReportUserModal #4051
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
feedId: user.id, | ||
}), | ||
onSuccess: () => { | ||
displayToast(`🚫 ${offendingUser.username} has been blocked`); |
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.
Agreed with Nimrod to change the message to this
onSuccess: () => { | ||
displayToast(`🚫 ${offendingUser.username} has been blocked`); |
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.
Just a question: Do we need to invalidate some query (like the current feed) on success?
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.
Good question. Not entirely sure. IIRC we don't invalidate the current feed when blocking sources, tags etc, just the selected post.
I guess adding optional callbacks wouldn't be a bad idea. I can check with product
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.
Normally we do refresh/remove the post from the feed relevant to the action, but we can maybe check with the product team on this one.
type ReportUserModalProps = { | ||
offendingUser: UserShortProfile; | ||
defaultBlockUser?: boolean; | ||
onClose: () => void; |
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.
do we need to pass this onClose? If we need to just close the modal we could avoid this props. Wdyt?
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.
We can actually just invoke useLazyModal in the modal itself and use the closeModal function.
packages/shared/src/components/modals/report/ReportUserModal.tsx
Outdated
Show resolved
Hide resolved
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.
Nice, thanks for updating! ✅
* feat: ReportUserModal (#4051) * feat: ReportUserModal * formatting * lint * remove unnecessary check * update conditional * remove need to pass onClose * capitalize values * feat: Add block and report to user profile (#4054) * feat: ReportUserModal * formatting * lint * remove unnecessary check * update conditional * remove need to pass onClose * capitalize values * feat: Add block and report to user profile * feat: Block, report, share on profile available for everyone (#4059) * feat: Block, report, share on profile available for everyone * update copy * update to still show share button when only 1 opt available * fix: Should not show following when blocked (#4064) * fix: Should not show following when blocked * update syntax * fix: No longer open report modal when reporting user (#4069) * fix: No longer open report modal when reporting user * add block request key to status map * feat: add block user option on post context menu (#4053) * feat: ReportUserModal * formatting * lint * remove unnecessary check * update conditional * feat: add block user option in post context menu * remove need to pass onClose * capitalize values * feat: add optimistic update on unblock * feat: refactor avoiding additional query * fix: ssr error * feat: add contentPreference data for author * feat: hide follow option for blocked users, change source block label; * feat: clear cache on block * feat: block on custom feed feature * test: update label for block/unblock * refactor: invalidate cache is not a utility * feat: added new labels and block directly without report modal * feat: hide post from feed and add undo action to toast --------- Co-authored-by: Amar Trebinjac <amartrebinjac@gmail.com> * update hateful key * Update packages/shared/src/components/modals/report/ReportUserModal.tsx Co-authored-by: Lee Hansel Solevilla <13744167+sshanzel@users.noreply.github.com> * fix: cache invalidation (#4078) * move query invalidation * remove unused hook * remove follow button on profile when blocked * feat: Remove default add btn in advanced settings, add block btn on u… (#4075) * feat: Remove default add btn in advanced settings, add block btn on users * make reusable component * invalidate specific feed * undo feed key * use onsettled to close * add author block * use username instead of name * try invalidate userblocked request key * use correct username * remove unnecessary feed invalidation * fix: block button inside link in source list (#4077) * feat: Remove default add btn in advanced settings, add block btn on users * make reusable component * fix: button inside link * fix: lint unused var * fix: moved key from children to parent * fix: UserList open in new tab --------- Co-authored-by: Amar Trebinjac <amartrebinjac@gmail.com> Co-authored-by: Amar Trebinjac <36768584+AmarTrebinjac@users.noreply.github.com> * fix: invalidation of blocked users for settings --------- Co-authored-by: Luca Pagliaro <pagliaroluca@gmail.com> Co-authored-by: Lee Hansel Solevilla <13744167+sshanzel@users.noreply.github.com> Co-authored-by: capJavert <dev@kickass.website>
Changes
Report / block user modal. Will be triggered when user presses any "block {user_name}" button. If block button is pressed, the block checkbox will be checked and disabled, as user is required to report if also blocking.
Will also be used on "report user" buttons. Here the "block {username}" checkbox will not be default checked, and user can toggle it.
Currently reporting/blocking will yield an error because the backend has not been updated to receive report entity type "user"
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
MI-741 #done
Preview domain
https://mi-741.preview.app.daily.dev