diff --git a/src/app/news/page.tsx b/src/app/news/page.tsx index bc438877..a7e116be 100644 --- a/src/app/news/page.tsx +++ b/src/app/news/page.tsx @@ -24,7 +24,7 @@ export default function App() { setNews(fetchedNews); }; getNews(); - }, [news]); + }, []); return (
diff --git a/src/app/testing/page.tsx b/src/app/testing/page.tsx deleted file mode 100644 index 2e66860c..00000000 --- a/src/app/testing/page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -// @ts-nocheck -'use client'; - -/* eslint-disable */ - -import React from 'react'; -import ImageScroller from '@/components/userComponents/ImageScroller/ImageScroller'; -import Carousel from '@/components/userComponents/ImageScroller/ImageScroller'; - -export default function Test() { - return ( -
- -
- ); -} diff --git a/src/components/userComponents/Footer/Footer.tsx b/src/components/userComponents/Footer/Footer.tsx index 9bc7cc8e..fbef46d0 100644 --- a/src/components/userComponents/Footer/Footer.tsx +++ b/src/components/userComponents/Footer/Footer.tsx @@ -344,12 +344,14 @@ export default function Footer() { const [inputValueEmail, setEmailValue] = useState(''); const [showError, setShowError] = useState(false); const [errorMsg, setErrorMsg] = useState(''); - - const subbed = () => - Boolean(JSON.parse(window.sessionStorage.getItem('subscribed') || 'false')); - const [subscribed, setSubscribed] = useState(subbed); + const [subscribed, setSubscribed] = useState(false); useEffect(() => { + const subbed = () => + Boolean( + JSON.parse(window.sessionStorage.getItem('subscribed') || 'false'), + ); + setSubscribed(subbed); window.sessionStorage.setItem('subscribed', subscribed.toString()); }, [subscribed]); diff --git a/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx b/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx index 863392d9..70ffb0f5 100644 --- a/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx +++ b/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx @@ -23,12 +23,12 @@ function HomeNewsFeed() { setNews(topThreeNews); }; getNews(); - }, [news]); + }, []); return (
{isWebDevice && ( = 1024); + const [isWeb, setIsWeb] = useState(false); + const handleResize = useCallback(() => { + setIsWeb(window.innerWidth >= 1024); + }, []); useEffect(() => { - const handleResize = () => setIsWeb(window.innerWidth >= 1024); + handleResize(); window.addEventListener('resize', handleResize); return () => { window.removeEventListener('resize', handleResize); }; - }, []); + }, [handleResize]); const windowWidthValue = useMemo(() => ({ isWeb }), [isWeb]);