aboutsummaryrefslogtreecommitdiff
path: root/components/home
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-09-25 00:44:40 +0700
committerGitHub <[email protected]>2023-09-25 00:44:40 +0700
commit1a85c2571690ba592ac5183d5eadaf9846fe532b (patch)
tree3f3552c00cd49c0eeab5275275cf5cf5666e5027 /components/home
parentDelete .github/workflows/deploy.yml (diff)
downloadmoopa-4.1.0.tar.xz
moopa-4.1.0.zip
Update v4.1.0 (#79)v4.1.0
* Update v4.1.0 * Update pages/_app.js
Diffstat (limited to 'components/home')
-rw-r--r--components/home/content.js19
-rw-r--r--components/home/staticNav.js168
2 files changed, 5 insertions, 182 deletions
diff --git a/components/home/content.js b/components/home/content.js
index c869f6b..9dd4408 100644
--- a/components/home/content.js
+++ b/components/home/content.js
@@ -305,6 +305,7 @@ export default function Content({
anime.image ||
anime.coverImage?.extraLarge ||
anime.coverImage?.large ||
+ anime?.coverImage ||
"https://cdn.discordapp.com/attachments/986579286397964290/1058415946945003611/gray_pfp.png"
}
alt={
@@ -336,7 +337,7 @@ export default function Content({
<p className="absolute z-40 text-center w-[86px] lg:w-[110px] top-1 -right-2 lg:top-[5.5px] lg:-right-2 font-karla text-sm lg:text-base">
Episode{" "}
<span className="text-white">
- {anime?.episodeNumber}
+ {anime?.currentEpisode || anime?.episodeNumber}
</span>
</p>
</Fragment>
@@ -377,16 +378,6 @@ export default function Content({
className="flex flex-col gap-2 shrink-0 cursor-pointer relative group/item"
>
<div className="absolute flex flex-col gap-1 z-40 top-1 right-1 transition-all duration-200 ease-out opacity-0 group-hover/item:opacity-100 scale-90 group-hover/item:scale-100 group-hover/item:visible invisible ">
- {/* <button
- type="button"
- className="flex flex-col items-center group/delete relative"
- onClick={() => removeItem(i.watchId)}
- >
- <XMarkIcon className="w-6 h-6 shrink-0 bg-primary p-1 rounded-full hover:text-action scale-100 hover:scale-105 transition-all duration-200 ease-out" />
- <span className="absolute font-karla bg-secondary shadow-black shadow-2xl py-1 px-2 whitespace-nowrap text-white text-sm rounded-md right-7 -bottom-[2px] z-40 duration-300 transition-all ease-out group-hover/delete:visible group-hover/delete:scale-100 group-hover/delete:translate-x-0 group-hover/delete:opacity-100 opacity-0 translate-x-10 scale-50 invisible">
- Remove from history
- </span>
- </button> */}
<HistoryOptions
remove={removeItem}
watchId={i.watchId}
@@ -443,10 +434,10 @@ export default function Content({
{i?.image && (
<Image
src={i?.image}
- width="0"
- height="0"
+ width={320}
+ height={180}
alt="Episode Thumbnail"
- className="w-fit group-hover:scale-[1.02] duration-300 ease-out z-10"
+ className="w-full object-cover group-hover:scale-[1.02] duration-300 ease-out z-10"
/>
)}
</Link>
diff --git a/components/home/staticNav.js b/components/home/staticNav.js
deleted file mode 100644
index 3f43461..0000000
--- a/components/home/staticNav.js
+++ /dev/null
@@ -1,168 +0,0 @@
-import { signIn, signOut, useSession } from "next-auth/react";
-import { getCurrentSeason } from "../../utils/getTimes";
-import Link from "next/link";
-// import { } from "@heroicons/react/24/solid";
-import { useSearch } from "../../lib/hooks/isOpenState";
-import Image from "next/image";
-import { UserIcon } from "@heroicons/react/20/solid";
-import { useRouter } from "next/router";
-
-export default function Navigasi() {
- const { data: sessions, status } = useSession();
- const year = new Date().getFullYear();
- const season = getCurrentSeason();
-
- const router = useRouter();
-
- const { setIsOpen } = useSearch();
-
- return (
- <>
- {/* NAVBAR PC */}
- <div className="flex items-center justify-center w-full">
- <div className="flex w-full items-center justify-between px-4 lg:w-[90%] lg:pt-7">
- <div className="flex items-center lg:gap-16">
- <Link
- href="/en/"
- className=" font-outfit lg:text-[40px] text-[30px] font-bold text-[#FF7F57]"
- >
- moopa
- </Link>
- <ul className="hidden items-center gap-10 pt-2 font-outfit text-[14px] lg:flex">
- <li>
- <Link
- href={`/en/search/anime?season=${season}&year=${year}`}
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- >
- This Season
- </Link>
- </li>
- <li>
- <Link
- href="/en/search/manga"
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- >
- Manga
- </Link>
- </li>
- <li>
- <Link
- href="/en/search/anime"
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- >
- Anime
- </Link>
- </li>
- <li>
- <Link
- href="/en/schedule"
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- >
- Schedule
- </Link>
- </li>
-
- {status === "loading" ? (
- <li>Loading...</li>
- ) : (
- <>
- {!sessions && (
- <li>
- <button
- onClick={() => signIn("AniListProvider")}
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- // className="px-2 py-1 ring-1 ring-action font-bold font-karla rounded-md"
- >
- Sign In
- </button>
- </li>
- )}
- {sessions && (
- <li className="text-center">
- <Link
- href={`/en/profile/${sessions?.user.name}`}
- className="hover:text-action/80 transition-all duration-150 ease-linear"
- >
- My List
- </Link>
- </li>
- )}
- </>
- )}
- </ul>
- </div>
- <div className="flex items-center gap-4">
- <button
- type="button"
- onClick={() => setIsOpen(true)}
- className="flex-center w-[26px] h-[26px]"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="32"
- height="32"
- viewBox="0 0 24 24"
- >
- <path
- fill="none"
- stroke="currentColor"
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth="2"
- d="M15 15l6 6m-11-4a7 7 0 110-14 7 7 0 010 14z"
- ></path>
- </svg>
- </button>
- {/* <div
- className="bg-white"
- // title={sessions ? "Go to Profile" : "Login With AniList"}
- > */}
- {sessions ? (
- <div className="w-8 h-8 relative flex flex-col items-center group">
- <button
- type="button"
- onClick={() =>
- router.push(`/en/profile/${sessions?.user.name}`)
- }
- className="rounded-full bg-white/30 overflow-hidden"
- >
- <Image
- src={sessions?.user.image.large}
- alt="avatar"
- width={50}
- height={50}
- className="w-full h-full object-cover"
- />
- </button>
- <div className="hidden absolute z-50 w-28 text-center -bottom-20 text-white shadow-2xl opacity-0 bg-secondary p-1 py-2 rounded-md font-karla font-light invisible group-hover:visible group-hover:opacity-100 duration-300 transition-all md:grid place-items-center gap-1">
- <Link
- href={`/en/profile/${sessions?.user.name}`}
- className="hover:text-action"
- >
- Profile
- </Link>
- <div
- onClick={() => signOut("AniListProvider")}
- className="hover:text-action cursor-pointer"
- >
- Log out
- </div>
- </div>
- </div>
- ) : (
- <button
- type="button"
- onClick={() => signIn("AniListProvider")}
- title="Login With AniList"
- className="w-7 h-7 bg-white/30 rounded-full overflow-hidden"
- >
- <UserIcon className="w-full h-full translate-y-2 text-white/50" />
- </button>
- )}
- {/* </div> */}
- </div>
- </div>
- </div>
- </>
- );
-}