From ee8d26dbd708860909354a0c590997192cb9d1f4 Mon Sep 17 00:00:00 2001 From: iqbalpa Date: Sun, 14 Jul 2024 07:11:08 +0700 Subject: [PATCH] fix: linter --- src/components/header/header.tsx | 10 +++++----- src/modules/signin/signin.tsx | 2 +- src/modules/watchlist/watchlist.tsx | 7 +++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx index 8231156..ccf5995 100644 --- a/src/components/header/header.tsx +++ b/src/components/header/header.tsx @@ -15,11 +15,6 @@ const antiHeader: string[] = ['/signup', '/signin']; const Header: React.FC = () => { const pathname = usePathname(); - const isSidebarDisabled = antiHeader.includes(pathname); - if (isSidebarDisabled) { - return null; - } - const user = useSelector((state: RootState) => state.user.user); const dispatch = useDispatch(); const router = useRouter(); @@ -37,6 +32,11 @@ const Header: React.FC = () => { return () => window.removeEventListener('scroll', handleScroll); }, []); + const isSidebarDisabled = antiHeader.includes(pathname); + if (isSidebarDisabled) { + return null; + } + const handleLogout = () => { dispatch(logout()); toast.success('Logged out'); diff --git a/src/modules/signin/signin.tsx b/src/modules/signin/signin.tsx index cd4287c..9e8d812 100644 --- a/src/modules/signin/signin.tsx +++ b/src/modules/signin/signin.tsx @@ -113,7 +113,7 @@ const SignInModule: React.FC = () => { />

- doesn't have an account?{' '} + doesn{`'`}t have an account?{' '} register diff --git a/src/modules/watchlist/watchlist.tsx b/src/modules/watchlist/watchlist.tsx index c5df6dc..8fc4ccc 100644 --- a/src/modules/watchlist/watchlist.tsx +++ b/src/modules/watchlist/watchlist.tsx @@ -43,7 +43,7 @@ const WatchlistModule = () => { } }; fetchWatchlist(); - }, [user, accessToken]); + }, [user, accessToken, router]); return (

@@ -59,7 +59,10 @@ const WatchlistModule = () => {
{watchlist.map((movie, index) => ( -
+