-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16c4c70
commit f77ed4d
Showing
12 changed files
with
843 additions
and
117 deletions.
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
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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
import authService from "../app/appwrite/auth"; | ||
import { authlogout } from "../app/GlobalRedux/Features/authSlice" | ||
import { useDispatch } from 'react-redux'; | ||
import { authlogout } from "../app/GlobalRedux/Features/authSlice"; | ||
import { useDispatch } from "react-redux"; | ||
|
||
function Logout() { | ||
const dispatch = useDispatch(); | ||
const setLogout = () => { | ||
authService.logout(). | ||
then(() => { | ||
dispatch(authlogout()) | ||
}); | ||
} | ||
return ( | ||
<button | ||
onClick={() => setLogout()} | ||
className="hover:underline text-red-600" | ||
> | ||
Logout | ||
</button> | ||
) | ||
const dispatch = useDispatch(); | ||
const setLogout = () => { | ||
authService.logout().then(() => { | ||
dispatch(authlogout()); | ||
}); | ||
}; | ||
return ( | ||
<button onClick={() => setLogout()} className="text-red-600 overflow-hidden"> | ||
Logout | ||
</button> | ||
); | ||
} | ||
|
||
export default Logout | ||
export default Logout; |
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
Oops, something went wrong.