Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Update v4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanAbinaya committed Oct 24, 2023
1 parent 100edf2 commit 0a30e05
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 198 deletions.
2 changes: 1 addition & 1 deletion components/anime/mobile/topSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion components/disqus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
29 changes: 6 additions & 23 deletions components/home/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
}, []);

Expand Down Expand Up @@ -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`);
}
};

Expand Down
21 changes: 1 addition & 20 deletions components/home/genres.js
Original file line number Diff line number Diff line change
@@ -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 = [
{
Expand Down Expand Up @@ -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">
Expand All @@ -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"
>
Expand Down
54 changes: 7 additions & 47 deletions components/shared/footer.js
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -51,52 +24,39 @@ 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>
</li>
</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">
Expand Down
12 changes: 8 additions & 4 deletions components/watch/primary/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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"
/>
) : (
Expand Down Expand Up @@ -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={{
Expand Down
48 changes: 2 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moopa",
"version": "4.2.0",
"version": "4.2.1",
"private": true,
"founder": "Factiven",
"scripts": {
Expand Down Expand Up @@ -30,13 +30,11 @@
"next-auth": "^4.22.0",
"next-pwa": "^5.6.0",
"nextjs-progressbar": "^0.0.16",
"nookies": "^2.5.2",
"rate-limiter-flexible": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
"react-loading-skeleton": "^3.2.0",
"react-toastify": "^9.1.3",
"react-use-draggable-scroll": "^0.4.7",
"sharp": "^0.32.6",
"sonner": "^1.0.3",
Expand Down
Loading

0 comments on commit 0a30e05

Please sign in to comment.