Skip to content

Commit

Permalink
client: Logo button
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham-Lal committed Apr 26, 2024
1 parent 76be906 commit 3101c32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/src/components/modal/auth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./index.css"
import { useState } from "react"
import { Link, useLocation, useNavigate } from "react-router-dom"
import { useLocation, useNavigate } from "react-router-dom"
import Lottie from "lottie-react"
import { useAuthStore, AuthTab, useTempStore } from "../../../store/useAuthStore"
import { Theme, useNavStore } from "../../../store/useNavStore"
Expand Down Expand Up @@ -40,15 +40,15 @@ const AuthModal = () => {
const newTheme = theme === Theme.Light ? Theme.Dark : Theme.Light;
document.querySelector("body")?.setAttribute('data-theme', newTheme);
setTheme(newTheme);
}
};

const handleCloseModal = () => {
if (location.pathname !== '/auth') setAuthTab(AuthTab.Closed);
else {
navigate('/');
setAuthTab(AuthTab.Closed);
}
}
};

const handleBackgroundClick = (event: React.MouseEvent<HTMLDivElement>) => {
if (location.pathname !== '/auth' && event.target === event.currentTarget) {
Expand Down Expand Up @@ -82,9 +82,9 @@ const AuthModal = () => {
)}
</div>
<>
<Link to='/' className='logo__wrapper'>
<button onClick={handleCloseModal} className='logo__wrapper'>
<img src="/logo.png" alt="" />
</Link>
</button>
<button
className='theme-btn'
onClick={handleToggleTheme}
Expand Down

0 comments on commit 3101c32

Please sign in to comment.