aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/anime/mobile/topSection.js2
-rw-r--r--components/disqus.js2
-rw-r--r--components/home/content.js29
-rw-r--r--components/home/genres.js21
-rw-r--r--components/shared/footer.js54
-rw-r--r--components/watch/primary/details.js12
6 files changed, 24 insertions, 96 deletions
diff --git a/components/anime/mobile/topSection.js b/components/anime/mobile/topSection.js
index e5f58da..6780da5 100644
--- a/components/anime/mobile/topSection.js
+++ b/components/anime/mobile/topSection.js
@@ -56,7 +56,7 @@ export default function DetailTop({
{/* MAIN */}
<div className="flex flex-col md:flex-row w-full items-center md:items-end gap-5 pt-12">
<div className="shrink-0 w-[180px] h-[250px] rounded overflow-hidden">
- <Image
+ <img
src={info?.coverImage?.extraLarge || info?.coverImage}
alt="poster anime"
width={300}
diff --git a/components/disqus.js b/components/disqus.js
index 724bec3..b814851 100644
--- a/components/disqus.js
+++ b/components/disqus.js
@@ -4,7 +4,7 @@ const DisqusComments = ({ post }) => {
const disqusShortname = post.name || "your_disqus_shortname";
const disqusConfig = {
url: post.url,
- identifier: post.id, // Single post id
+ identifier: post.url, // Single post id
title: `${post.title} - Episode ${post.episode}`, // Single post title
};
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"
>
diff --git a/components/shared/footer.js b/components/shared/footer.js
index 0e19f13..a29a3d3 100644
--- a/components/shared/footer.js
+++ b/components/shared/footer.js
@@ -1,45 +1,18 @@
import Link from "next/link";
-import { useEffect, useState } from "react";
+import { useState } from "react";
import { useRouter } from "next/router";
-import { parseCookies, setCookie } from "nookies";
-import Image from "next/image";
function Footer() {
const [year] = useState(new Date().getFullYear());
const [season] = useState(getCurrentSeason());
- const [lang, setLang] = useState("en");
const [checked, setChecked] = useState(false);
- const [cookie, setCookies] = useState(null);
const router = useRouter();
- useEffect(() => {
- let lang = null;
- if (!cookie) {
- const cookie = parseCookies();
- lang = cookie.lang || null;
- setCookies(cookie);
- }
- if (lang === "en" || lang === null) {
- setLang("en");
- setChecked(false);
- } else if (lang === "id") {
- setLang("id");
- setChecked(true);
- }
-
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
-
function switchLang() {
setChecked(!checked);
if (checked) {
- console.log("switching to en");
- setCookie(null, "lang", "en", {
- maxAge: 365 * 24 * 60 * 60,
- path: "/",
- });
router.push("/en");
} else {
router.push("/id");
@@ -51,36 +24,25 @@ function Footer() {
<div className="text-[#dbdcdd] z-40 bg-[#0c0d10] lg:flex lg:h-[12rem] w-full lg:items-center lg:justify-between">
<div className="mx-auto flex w-[90%] lg:w-[95%] xl:w-[80%] flex-col space-y-10 py-6 lg:flex-row lg:items-center lg:justify-between lg:space-y-0 lg:py-0">
<div className="flex flex-col gap-2">
- {/* <div className="flex items-center gap-2"> */}
- {/* <Image
- src="/svg/c.svg"
- alt="Website Logo"
- width={100}
- height={100}
- className="w-10 h-10"
- /> */}
<div className="flex gap-2 font-outfit text-4xl">moopa</div>
<p className="font-karla lg:text-[0.8rem] text-[0.65rem] text-[#9c9c9c] lg:w-[520px] italic">
This site does not store any files on our server, we only linked
to the media which is hosted on 3rd party services.
</p>
- {/* </div> */}
</div>
<div className="flex flex-col gap-10 lg:flex-row lg:items-end lg:gap-[9.06rem] text-[#a7a7a7] text-sm lg:text-end">
<div className="flex flex-col gap-10 font-karla font-bold lg:flex-row lg:gap-[5.94rem]">
<ul className="flex flex-col gap-y-[0.7rem] ">
<li className="cursor-pointer hover:text-action">
- <Link
- href={`/${lang}/search/anime?season=${season}&year=${year}`}
- >
+ <Link href={`/en/search/anime?season=${season}&year=${year}`}>
This Season
</Link>
</li>
<li className="cursor-pointer hover:text-action">
- <Link href={`/${lang}/search/anime`}>Popular Anime</Link>
+ <Link href={`/en/search/anime`}>Popular Anime</Link>
</li>
<li className="cursor-pointer hover:text-action">
- <Link href={`/${lang}/search/manga`}>Popular Manga</Link>
+ <Link href={`/en/search/manga`}>Popular Manga</Link>
</li>
<li className="cursor-pointer hover:text-action">
<Link href={`/donate`}>Donate</Link>
@@ -88,15 +50,13 @@ function Footer() {
</ul>
<ul className="flex flex-col gap-y-[0.7rem]">
<li className="cursor-pointer hover:text-action">
- <Link href={`/${lang}/search/anime?format=MOVIE`}>
- Movies
- </Link>
+ <Link href={`/en/search/anime?format=MOVIE`}>Movies</Link>
</li>
<li className="cursor-pointer hover:text-action">
- <Link href={`/${lang}/search/anime?format=TV`}>TV Shows</Link>
+ <Link href={`/en/search/anime?format=TV`}>TV Shows</Link>
</li>
<li className="cursor-pointer hover:text-action">
- <Link href={`/${lang}/dmca`}>DMCA</Link>
+ <Link href={`/en/dmca`}>DMCA</Link>
</li>
<li className="cursor-pointer hover:text-action">
<Link href="https://github.com/DevanAbinaya/Ani-Moopa">
diff --git a/components/watch/primary/details.js b/components/watch/primary/details.js
index 32e1391..4af12ac 100644
--- a/components/watch/primary/details.js
+++ b/components/watch/primary/details.js
@@ -26,7 +26,12 @@ export default function Details({
}
useEffect(() => {
- setShowComments(false);
+ const isMobile = window.matchMedia("(max-width: 768px)").matches;
+ if (isMobile) {
+ setShowComments(false);
+ } else {
+ setShowComments(true);
+ }
}, [id]);
return (
@@ -35,12 +40,11 @@ export default function Details({
<div className="pb-4 h-full flex">
<div className="aspect-[9/13] h-[240px]">
{info ? (
- <Image
+ <img
src={info.coverImage.extraLarge}
alt="Anime Cover"
width={1000}
height={1000}
- priority
className="object-cover aspect-[9/13] h-[240px] rounded-md"
/>
) : (
@@ -169,7 +173,7 @@ export default function Details({
{showComments && (
<div>
{info && (
- <div className="mt-5 px-5">
+ <div className="mt-5">
<DisqusComments
key={id}
post={{