From 50a0f0240d7fef133eb5acc1bea2b1168b08e9db Mon Sep 17 00:00:00 2001 From: Factiven Date: Sun, 24 Dec 2023 13:03:54 +0700 Subject: migrate to typescript --- components/anime/mobile/topSection.js | 323 ---------------------------------- 1 file changed, 323 deletions(-) delete mode 100644 components/anime/mobile/topSection.js (limited to 'components/anime/mobile/topSection.js') diff --git a/components/anime/mobile/topSection.js b/components/anime/mobile/topSection.js deleted file mode 100644 index 6780da5..0000000 --- a/components/anime/mobile/topSection.js +++ /dev/null @@ -1,323 +0,0 @@ -import { - BookOpenIcon, - PlayIcon, - PlusIcon, - ShareIcon, -} from "@heroicons/react/24/solid"; -import Image from "next/image"; -import { useRouter } from "next/router"; -import { useEffect, useState } from "react"; -import { convertSecondsToTime } from "@/utils/getTimes"; -import Link from "next/link"; -import InfoChip from "./reused/infoChip"; -import Description from "./reused/description"; -import { NewNavbar } from "@/components/shared/NavBar"; - -export default function DetailTop({ - info, - statuses, - handleOpen, - watchUrl, - progress, - color, -}) { - const router = useRouter(); - const [readMore, setReadMore] = useState(false); - - const [showAll, setShowAll] = useState(false); - - const isAnime = info.type === "ANIME"; - - useEffect(() => { - setReadMore(false); - }, [info.id]); - - const handleShareClick = async () => { - try { - if (navigator.share) { - await navigator.share({ - title: `${isAnime ? "Watch" : "Read"} Now - ${info?.title?.english}`, - // text: `Watch [${info?.title?.romaji}] and more on Moopa. Join us for endless anime entertainment"`, - url: window.location.href, - }); - } else { - // Web Share API is not supported, provide a fallback or show a message - alert("Web Share API is not supported in this browser."); - } - } catch (error) { - console.error("Error sharing:", error); - } - }; - - return ( -
- - - {/* MAIN */} -
-
- poster anime -
-
-
-

- {info?.season?.toLowerCase() || getMonth(info?.startDate?.month)}{" "} - {info.seasonYear || info?.startDate?.year} -

-

- {info?.title?.romaji || info?.title?.english} -

-

- {info.title?.english} -

- - {info?.description && ( - - )} -
-
-
- -
- -
- - - - - See on AniList - - anilist_icon - -
-
- -
- - - -
- - {info.nextAiringEpisode?.timeUntilAiring && ( -

- Episode {info.nextAiringEpisode.episode} in{" "} - - {convertSecondsToTime(info.nextAiringEpisode.timeUntilAiring)}{" "} - -

- )} - - {info?.description && ( - - )} - - - - {info?.relations?.edges?.length > 0 && ( -
-
- {info?.relations?.edges?.length > 0 && ( -
- Relations -
- )} - {info?.relations?.edges?.length > 3 && ( -
setShowAll(!showAll)} - > - {showAll ? "show less" : "show more"} -
- )} -
-
- {info?.relations?.edges - .slice(0, showAll ? info?.relations?.edges.length : 3) - .map((r, index) => { - const rel = r.node; - return ( - -
-
- {rel.id} -
-
-
- {r.relationType.replace(/_/g, " ")} -
-
- {rel.title.userPreferred} -
-
{rel.format}
-
-
- - ); - })} -
-
- )} -
- ); -} - -function getMonth(month) { - if (!month) return ""; - const formattedMonth = new Date(0, month).toLocaleString("default", { - month: "long", - }); - return formattedMonth; -} -- cgit v1.2.3