-
Notifications
You must be signed in to change notification settings - Fork 405
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: added button to stop searching for a buddy #208
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @Dun-sin on Vercel. @Dun-sin first needs to authorize it. |
@Dun-sin there you go, for your convention a different branch. I hope you will update your rules to ask contributors to follow the convention for your repository. |
I did, don't know if you mean a rephrase because here it is ππΎ |
This PR doesn't fix the issue, the user is still on the waiting line for connecting with someone else, it has to totally stop, don't know if it's a miscommunication, but this PR should fix the following:
|
Oh okay, let me figure this out to an approach and ping you before going ahead on code. Thanks for clearing it out. |
@ays14 what you just did with the contributing file is none of this PRs business, so kindly delete and create a separate issue |
Approach:
|
This was already removed within seconds after the push. |
It has a backend, frontend, and a database Line 42 in 421ebac
there's already a function to handle removing a user from the searching object Lines 423 to 425 in 421ebac
Line 448 in 421ebac
you just need to create a socket event to detect when a user clicks the stop button |
@Dun-sin does this look good? server: index.js socket.on('stop_search', async ({ loginId, email }) => {
await delWaitingUser(loginId ?? email);
socket.emit('stop_search_success');
}); client: BuddyMatcher.jsx const handleStopSearch = () => {
socket.emit('stop_search', { loginId: auth.loginId, email: auth.email });
setIsStoppingSearch(true);
};
useEffect(() => {
setLoadingText(isStoppingSearch ? stoppingSearchLoadingText : defaultLoadingText);
}, [isStoppingSearch]);
...
useEffect(() => {
...
socket.on('stop_search_success', () => {
navigate('/');
});
...
, [])
return isFound ? ... :
{!isStoppingSearch && <button
onClick={handleStopSearch}
className={
'hover:no-underline hover:text-white font-medium text-white text-[1.5em] w-[8em] h-[2.3em] mt-4 rounded-[30px] border-4 border-solid border-[#f04336] flex flex-col items-center justify-center'
}
>
Stop
</button>} |
looks good |
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
Also, change the colour for the stop button, let it not be a border but a background of #FF3A46 hex color |
@ays14 change the following:
to:
|
@mathiasayivor @Dun-sin done |
@ays14 did you test this? because it shows stopping search but never does |
@ays14 sorry never mind, it's not your fault lol |
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.
Looks Good ππΎ Thank you for contributing your PR is accepted, I hope you continue to contribute to this project
Check out the community discord server ππ½hereππ½
* feat: added button to stop searching for a buddy (#208) * feat: added button to stop searching for a buddy * add changes to remove user from waiting list * Update BuddyMatcher.jsx Co-authored-by: ayush-pingsafe <[email protected]> * fix: mobile display (#205) * chore: install @rsuite/icons package * fix: mobile display Co-authored-by: Ayush Sharma <[email protected]> Co-authored-by: ayush-pingsafe <[email protected]> Co-authored-by: Mathias Ayivor <[email protected]>
* feat: added button to stop searching for a buddy (#208) * feat: added button to stop searching for a buddy * add changes to remove user from waiting list * Update BuddyMatcher.jsx Co-authored-by: ayush-pingsafe <[email protected]> * fix: mobile display (#205) * chore: install @rsuite/icons package * fix: mobile display * fix: maintain the same state between navigation (#215) * fix: update context when stop btn is clicked (#224) * fix: users can navigate whiles chatting on mobile (#226) Co-authored-by: Ayush Sharma <[email protected]> Co-authored-by: ayush-pingsafe <[email protected]> Co-authored-by: Mathias Ayivor <[email protected]>
Fixes Issue
closes #132
π¨βπ» Changes proposed(What did you do ?)
Created a button titled as
Stop
inBuddyMatcher.jsx
which is a link to/
and redirects you to home on click. Since, there is an effect with the callback that closes the socket and does necessary steps when component unmounts. Therefore, I need not worry about the same when redirecting to/
with react-router.βοΈ Check List (Check all the applicable boxes)
Note to reviewers
π· Screenshots