diff options
| author | Factiven <[email protected]> | 2023-10-24 11:05:06 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-10-24 11:05:06 +0700 |
| commit | 0a30e0570a5d22dd8c459fd9769fe4386c07aae8 (patch) | |
| tree | 67346a73b4be2ed5e5a7008828e4bc70bac3bd92 /components/home/content.js | |
| parent | fixed redis error for manga (#95) (diff) | |
| download | moopa-4.2.1.tar.xz moopa-4.2.1.zip | |
Update v4.2.1v4.2.1
Diffstat (limited to 'components/home/content.js')
| -rw-r--r-- | components/home/content.js | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/components/home/content.js b/components/home/content.js index 678549c..a380e1f 100644 --- a/components/home/content.js +++ b/components/home/content.js @@ -8,8 +8,6 @@ import { ArrowRightCircleIcon, } from "@heroicons/react/24/outline"; -import { parseCookies } from "nookies"; - import { ChevronLeftIcon } from "@heroicons/react/20/solid"; import { ExclamationCircleIcon, PlayIcon } from "@heroicons/react/24/solid"; import { useRouter } from "next/router"; @@ -30,30 +28,15 @@ export default function Content({ const ref = useRef(); const { events } = useDraggable(ref); - const [cookie, setCookie] = useState(null); const [clicked, setClicked] = useState(false); - const [lang, setLang] = useState("en"); - useEffect(() => { const click = localStorage.getItem("clicked"); if (click) { setClicked(JSON.parse(click)); } - - let lang = null; - if (!cookie) { - const cookie = parseCookies(); - lang = cookie.lang || null; - setCookie(cookie); - } - if (lang === "en" || lang === null) { - setLang("en"); - } else if (lang === "id") { - setLang("id"); - } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -109,22 +92,22 @@ export default function Content({ const goToPage = () => { if (section === "Recently Watched") { - router.push(`/${lang}/anime/recently-watched`); + router.push(`/en/anime/recently-watched`); } if (section === "New Episodes") { - router.push(`/${lang}/anime/recent`); + router.push(`/en/anime/recent`); } if (section === "Trending Now") { - router.push(`/${lang}/anime/trending`); + router.push(`/en/anime/trending`); } if (section === "Popular Anime") { - router.push(`/${lang}/anime/popular`); + router.push(`/en/anime/popular`); } if (section === "Your Plan") { - router.push(`/${lang}/profile/${userName}/#planning`); + router.push(`/en/profile/${userName}/#planning`); } if (section === "On-Going Anime" || section === "Your Watch List") { - router.push(`/${lang}/profile/${userName}/#current`); + router.push(`/en/profile/${userName}/#current`); } }; |