-
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: Remove default add btn in advanced settings, add block btn on u… #4075
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
return ( | ||
<Button | ||
onClick={(e) => { | ||
e.preventDefault(); |
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.
Why do we need to prevent default? If this button is submitting some form we can add type="button"
and prevent it :)
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.
It's wrapped inside a link in another component. Unfortunately not much to be done about other than this
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.
IMO it's a major mistake have a button inside a link, so I've opened a PR fixing this issue
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.
I agree with the wrapping concern. Normally, React automatically detecs those kind of nesting and prompts a warning in the console.
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 some minor feedback, overall GJ ✔️
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.
🚀
* 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
Custom feed design has the unblock button:
![image](https://private-user-images.githubusercontent.com/36768584/404077028-d68df4cb-4f5a-4631-8c80-31a261628c13.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDYyNTIsIm5iZiI6MTczOTAwNTk1MiwicGF0aCI6Ii8zNjc2ODU4NC80MDQwNzcwMjgtZDY4ZGY0Y2ItNGY1YS00NjMxLThjODAtMzFhMjYxNjI4YzEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA5MTIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlNDBjZTg2NTk5ZjdkNDM4MGE2ZmFlMWM4MWRhYTBlN2FhOWNhMTQ0ZWZiMTczNzZiNzE0ZTlkMWFkMzZkZjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WytDc_lkCX1WWzZaKgBaE2-2T3EdhRXWpGReEnhj_nk)
But currently, all tabs look like this:
![image](https://private-user-images.githubusercontent.com/36768584/404066491-3a09eda8-ea7f-4fb3-b0c6-03073e70c6af.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDYyNTIsIm5iZiI6MTczOTAwNTk1MiwicGF0aCI6Ii8zNjc2ODU4NC80MDQwNjY0OTEtM2EwOWVkYTgtZWE3Zi00ZmIzLWIwYzYtMDMwNzNlNzBjNmFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA5MTIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmYzIxY2QzZjZkZjljZDNmYWIxNzA4MDllYmFhZjM2MGRmYTliZWJmMjgxM2ZlMDJlNWRiZmFjYWM1Njg3ZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MoUSEoR_Rw_B60n0Aw3P1ciF9pb2ePMoqOBSLdMAIA8)
And they function as a follow button. So I updated it to be as in the design
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
Preview domain
https://mi-758.preview.app.daily.dev