aboutsummaryrefslogtreecommitdiff
path: root/components/home
diff options
context:
space:
mode:
Diffstat (limited to 'components/home')
-rw-r--r--components/home/content.js29
-rw-r--r--components/home/genres.js21
2 files changed, 7 insertions, 43 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`);
}
};
diff --git a/components/home/genres.js b/components/home/genres.js
index cd247ce..9c80ca6 100644
--- a/components/home/genres.js
+++ b/components/home/genres.js
@@ -1,8 +1,6 @@
import Image from "next/image";
import { ChevronRightIcon } from "@heroicons/react/24/outline";
import Link from "next/link";
-import { useEffect, useState } from "react";
-import { parseCookies } from "nookies";
const g = [
{
@@ -32,23 +30,6 @@ const g = [
];
export default function Genres() {
- const [lang, setLang] = useState("en");
- const [cookie, setCookie] = useState(null);
-
- useEffect(() => {
- 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
- }, []);
return (
<div className="antialiased">
<div className="flex items-center justify-between lg:justify-normal lg:gap-3 px-5">
@@ -61,7 +42,7 @@ export default function Genres() {
<div className="flex lg:gap-10 gap-4">
{g.map((a, index) => (
<Link
- href={`${lang}/search/anime/?genres=${a.name}`}
+ href={`/en/search/anime/?genres=${a.name}`}
key={index}
className="relative hover:shadow-lg hover:scale-105 duration-200 cursor-pointer ease-out h-[190px] w-[135px] lg:h-[265px] lg:w-[230px] rounded-md shrink-0"
>