Skip to content

Commit

Permalink
Merge pull request hiteshchoudhary#159 from arnb-smnta/feat/chatapp-l…
Browse files Browse the repository at this point in the history
…ogout-button

Feat/chatapp logout button
  • Loading branch information
wajeshubham authored May 17, 2024
2 parents adefc21 + 78a4dc6 commit 8fbf8c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MESSAGE_DELETE_EVENT = "messageDeleted";

const ChatPage = () => {
// Import the 'useAuth' and 'useSocket' hooks from their respective contexts
const { user } = useAuth();
const { user, logout } = useAuth();
const { socket } = useSocket();

// Create a reference using 'useRef' to hold the currently selected chat.
Expand Down Expand Up @@ -426,6 +426,14 @@ const ChatPage = () => {
<div className="w-full justify-between items-stretch h-screen flex flex-shrink-0">
<div className="w-1/3 relative ring-white overflow-y-auto px-4">
<div className="z-10 w-full sticky top-0 bg-dark py-4 flex justify-between items-center gap-4">
<button
type="button"
className="focus:outline-none text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-xl text-sm px-5 py-4 mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900 flex-shrink-0"
onClick={logout}
>
Log Out
</button>

<Input
placeholder="Search user or group..."
value={localSearchQuery}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6412,4 +6412,4 @@ [email protected]:
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

0 comments on commit 8fbf8c1

Please sign in to comment.