diff options
| author | Factiven <[email protected]> | 2023-09-25 00:44:40 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-25 00:44:40 +0700 |
| commit | 1a85c2571690ba592ac5183d5eadaf9846fe532b (patch) | |
| tree | 3f3552c00cd49c0eeab5275275cf5cf5666e5027 /pages/en/schedule | |
| parent | Delete .github/workflows/deploy.yml (diff) | |
| download | moopa-1a85c2571690ba592ac5183d5eadaf9846fe532b.tar.xz moopa-1a85c2571690ba592ac5183d5eadaf9846fe532b.zip | |
Update v4.1.0 (#79)v4.1.0
* Update v4.1.0
* Update pages/_app.js
Diffstat (limited to 'pages/en/schedule')
| -rw-r--r-- | pages/en/schedule/index.js | 65 |
1 files changed, 14 insertions, 51 deletions
diff --git a/pages/en/schedule/index.js b/pages/en/schedule/index.js index ddb0a49..f1e6730 100644 --- a/pages/en/schedule/index.js +++ b/pages/en/schedule/index.js @@ -1,24 +1,24 @@ import Image from "next/image"; import { useEffect, useRef, useState } from "react"; -import { NewNavbar } from "../../../components/anime/mobile/topSection"; import Link from "next/link"; import { CalendarIcon } from "@heroicons/react/24/solid"; import { ClockIcon } from "@heroicons/react/24/outline"; -import Loading from "../../../components/shared/loading"; -import { timeStamptoAMPM, timeStamptoHour } from "../../../utils/getTimes"; +import Loading from "@/components/shared/loading"; +import { timeStamptoAMPM, timeStamptoHour } from "@/utils/getTimes"; import { filterFormattedSchedule, filterScheduleByDay, sortScheduleByDay, transformSchedule, -} from "../../../utils/schedulesUtils"; +} from "@/utils/schedulesUtils"; -import { scheduleQuery } from "../../../lib/graphql/query"; -import MobileNav from "../../../components/shared/MobileNav"; +import { scheduleQuery } from "@/lib/graphql/query"; +import MobileNav from "@/components/shared/MobileNav"; import { useSession } from "next-auth/react"; -import redis from "../../../lib/redis"; +import { redis } from "@/lib/redis"; import Head from "next/head"; +import { NewNavbar } from "@/components/shared/NavBar"; const day = [ "Sunday", @@ -64,9 +64,6 @@ export async function getServerSideProps() { if (cachedData) { const scheduleByDay = JSON.parse(cachedData); - // const today = now.getDay(); - // const todaySchedule = day[today]; - return { props: { schedule: scheduleByDay, @@ -81,21 +78,6 @@ export async function getServerSideProps() { const weekStart = yesterdayStart; const weekEnd = weekStart + 604800; - // const today = now.getDay(); - // const todaySchedule = day[today]; - - // const now = new Date(); - // const currentDayOfWeek = now.getDay(); // 0 = Sunday, 1 = Monday, ..., 6 = Saturday - - // // Calculate the number of seconds until the current Saturday at 00:00:00 - // const secondsUntilSaturday = (6 - currentDayOfWeek) * 24 * 60 * 60; - - // // Calculate weekStart as the current time minus secondsUntilSaturday - // const weekStart = Math.floor(now.getTime() / 1000) - secondsUntilSaturday; - - // // Calculate weekEnd as one week from weekStart - // const weekEnd = weekStart + 604800; // One week in seconds - let page = 1; const airingSchedules = []; @@ -283,8 +265,8 @@ export default function Schedule({ schedule }) { /> </Head> <MobileNav sessions={session} hideProfile={true} /> + <NewNavbar scrollP={10} toTop={true} /> <div className="w-screen"> - <NewNavbar scrollP={10} session={session} toTop={true} /> <span className="absolute z-20 top-0 left-0 w-screen h-[190px] lg:h-[250px] bg-secondary overflow-hidden"> <div className="absolute top-40 lg:top-36 w-full h-full bg-primary rounded-t-3xl xl:rounded-t-[50px]" /> </span> @@ -376,13 +358,13 @@ export default function Schedule({ schedule }) { key={m.id} // id={`same_${m.id}`} href={`/en/${m.type.toLowerCase()}/${m.id}`} - className={`flex bg-secondary rounded group cursor-pointer ml-4 z-50`} + className={`flex bg-secondary rounded group cursor-pointer overflow-hidden ml-4 z-50`} > <Image src={m.coverImage.extraLarge} alt="image" - width="0" - height="0" + width={300} + height={300} className="w-[50px] h-[65px] object-cover shrink-0" /> <div className="flex flex-col justify-center font-karla p-2"> @@ -469,31 +451,12 @@ export default function Schedule({ schedule }) { <span className="tooltip">Airing Now</span> </span> </p> - {/* <span - className={`${ - s.id === nextAiringAnime - ? "bg-orange-700 text-sm px-3 py-1 rounded-full font-bold text-white" - : "" - } mx-auto`} - > - Airing Next - </span> */} - {/* </p> */} - {/* {s.media?.bannerImage && ( - <Image - src={s.media?.bannerImage} - alt="banner" - width="0" - height="0" - className="absolute pointer-events-none top-0 opacity-0 group-hover:opacity-10 transition-all duration-500 ease-linear -z-10 left-0 rounded-l w-full h-[250px] object-cover" - /> - )} */} <Image src={m.coverImage.extraLarge} alt="image" - width="0" - height="0" - className="w-[50px] h-[65px] object-cover shrink-0" + width={200} + height={200} + className="w-[50px] h-[65px] object-cover shrink-0 rounded-l" /> <div className="flex flex-col justify-center font-karla p-2"> <h1 className="font-semibold line-clamp-1 text-sm group-hover:text-action transition-all duration-200 ease-out"> |