From 1a85c2571690ba592ac5183d5eadaf9846fe532b Mon Sep 17 00:00:00 2001 From: Factiven Date: Mon, 25 Sep 2023 00:44:40 +0700 Subject: Update v4.1.0 (#79) * Update v4.1.0 * Update pages/_app.js --- pages/en/schedule/index.js | 65 ++++++++++------------------------------------ 1 file changed, 14 insertions(+), 51 deletions(-) (limited to 'pages/en/schedule/index.js') 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 }) { /> +
-
@@ -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
@@ -469,31 +451,12 @@ export default function Schedule({ schedule }) { Airing Now

- {/* - Airing Next - */} - {/*

*/} - {/* {s.media?.bannerImage && ( - banner - )} */} image

-- cgit v1.2.3