From 498a10c96f15381c17bfec293da0208c069d388c Mon Sep 17 00:00:00 2001 From: Factiven Date: Thu, 20 Jul 2023 12:25:11 +0700 Subject: Update v3.6.6 > Added functionality to see more anime at home page > fixed some bugs --- components/home/content.js | 35 +++++++- components/home/mobileNav.js | 202 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+), 4 deletions(-) create mode 100644 components/home/mobileNav.js (limited to 'components') diff --git a/components/home/content.js b/components/home/content.js index d67483d..9b2b1a9 100644 --- a/components/home/content.js +++ b/components/home/content.js @@ -11,8 +11,11 @@ import { parseCookies } from "nookies"; import { ChevronLeftIcon } from "@heroicons/react/20/solid"; import { ExclamationCircleIcon } from "@heroicons/react/24/solid"; +import { useRouter } from "next/router"; + +export default function Content({ ids, section, data, og, userName }) { + const router = useRouter(); -export default function Content({ ids, section, data, og }) { const [startX, setStartX] = useState(null); const containerRef = useRef(null); const [cookie, setCookie] = useState(null); @@ -111,9 +114,29 @@ export default function Content({ ids, section, data, og }) { const slicedData = filteredData?.length > 15 ? filteredData?.slice(0, 15) : filteredData; + const goToPage = () => { + if (section === "Trending Now") { + router.push(`/${lang}/anime/trending`); + } + if (section === "Popular Anime") { + router.push(`/${lang}/anime/popular`); + } + if (section === "Your Plan") { + router.push(`/${lang}/profile/${userName}/#planning`); + } + if (section === "On-Going Anime" || section === "Your Watch List") { + router.push(`/${lang}/profile/${userName}/#current`); + } + }; + return (
-
+

{section}

@@ -210,8 +233,12 @@ export default function Content({ ids, section, data, og }) { ); })} {filteredData.length >= 10 && section !== "Recommendations" && ( -
-
+
+

More on {section}

diff --git a/components/home/mobileNav.js b/components/home/mobileNav.js new file mode 100644 index 0000000..52c9d52 --- /dev/null +++ b/components/home/mobileNav.js @@ -0,0 +1,202 @@ +import { signIn, signOut } from "next-auth/react"; +import Link from "next/link"; +import { useState } from "react"; + +export default function MobileNav({ sessions }) { + const [isVisible, setIsVisible] = useState(false); + + const handleShowClick = () => { + setIsVisible(true); + }; + + const handleHideClick = () => { + setIsVisible(false); + }; + return ( + <> + {/* NAVBAR */} +
+ {!isVisible && ( + + )} +
+ + {/* Mobile Menu */} +
+ {isVisible && sessions && ( + + user avatar + + )} + {isVisible && ( +
+
+ + + + {sessions ? ( + + ) : ( + + )} +
+ +
+ )} +
+ + ); +} -- cgit v1.2.3