From 0a30e0570a5d22dd8c459fd9769fe4386c07aae8 Mon Sep 17 00:00:00 2001 From: Factiven Date: Tue, 24 Oct 2023 11:05:06 +0700 Subject: Update v4.2.1 --- components/anime/mobile/topSection.js | 2 +- components/disqus.js | 2 +- components/home/content.js | 29 ++++--------------- components/home/genres.js | 21 +------------- components/shared/footer.js | 54 +++++------------------------------ components/watch/primary/details.js | 12 +++++--- 6 files changed, 24 insertions(+), 96 deletions(-) (limited to 'components') 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 */}
- poster anime { 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 (
@@ -61,7 +42,7 @@ export default function Genres() {
{g.map((a, index) => ( 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() {
- {/*
*/} - {/* Website Logo */}
moopa

This site does not store any files on our server, we only linked to the media which is hosted on 3rd party services.

- {/*
*/}
  • - + This Season
  • - Popular Anime + Popular Anime
  • - Popular Manga + Popular Manga
  • Donate @@ -88,15 +50,13 @@ function Footer() {
  • - - Movies - + Movies
  • - TV Shows + TV Shows
  • - DMCA + DMCA
  • 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({
    {info ? ( - Anime Cover ) : ( @@ -169,7 +173,7 @@ export default function Details({ {showComments && (
    {info && ( -
    +