From 545d8a3473823f0a86cad3c177dbbb4ebb794a75 Mon Sep 17 00:00:00 2001 From: Factiven Date: Mon, 17 Apr 2023 13:33:37 +0700 Subject: Snapshot Moopa v3.2 --- pages/test.js | 236 ---------------------------------------------------------- 1 file changed, 236 deletions(-) delete mode 100644 pages/test.js (limited to 'pages/test.js') diff --git a/pages/test.js b/pages/test.js deleted file mode 100644 index 0db3a17..0000000 --- a/pages/test.js +++ /dev/null @@ -1,236 +0,0 @@ -import { signIn, signOut, useSession } from "next-auth/react"; -import { useEffect, useState } from "react"; -import { useQuery } from "@apollo/client"; -import { GET_MEDIA } from "../queries"; -import StackPlayer from "../components/test/player"; -import Modal from "../components/modal"; - -import { AniData as data } from "../components/test/dataAni"; -import Image from "next/image"; -import { client } from "../lib/apolloClient"; -import Link from "next/link"; -import { useAniList } from "../lib/useAnilist"; - -export default function AniTest() { - const { data: session, status } = useSession(); - const { media, aniAdvanceSearch, markComplete } = useAniList(session); - const [advanceSearch, setAdvanceSearch] = useState(); - - const [search, setSearch] = useState(); - const [type, setType] = useState("ANIME"); - const [seasonYear, setSeasonYear] = useState(); - const [season, setSeason] = useState(); - const [genres, setGenres] = useState(); - const [perPage, setPerPage] = useState(25); - const [sort, setSort] = useState(["POPULARITY_DESC"]); - - // async function handleUpdateMediaEntry(entryId, status, progress, score) { - // try { - // const updatedEntry = await updateMediaEntry( - // entryId, - // status, - // progress, - // score - // ); - // console.log(updatedEntry); - // } catch (error) { - // console.error(error); - // } - // } - - // const userId = session?.user?.id; - // const MediaList = ({ userId }) => { - // const { data, loading, error } = useQuery(GET_MEDIA, { - // variables: { page: 1, userId, type: "ANIME", status: "COMPLETED" }, - // }); - - // if (loading) return

Loading...

; - // if (error) return

Error :(

; - - // const { mediaList } = data.Page; - // console.log(mediaList); - // }; - - // const [open, setOpen] = useState(false); - - async function markAsComplete(id) { - const response = await markComplete(id); - console.log(response); - } - - async function advance() { - const data = await aniAdvanceSearch( - search, - type, - seasonYear, - season, - genres, - perPage, - sort - ); - setAdvanceSearch(data); - } - - useEffect(() => { - advance(); - }, [search, type, seasonYear, season, genres, perPage, sort]); - - if (status === "loading") { - return
Loading...
; - } - - const astatus = "COMPLETED"; - - // const { data } = aniAdvanceSearch({ - // search: "naruto", - // }); - - // console.log(advanceSearch); - - return ( - //
- // - //
- <> - {/* - setOpen(false)}> -
-
- iamge -
-
Episode 6
-
test
-
-
*/} - {!session && ( - - )} - {session && ( -
- - -
- )} - {media?.length > 0 && ( -
- {media.map((item, index) => { - return ( -
-

{item.name}

-
- {item.entries.map((items, index) => { - return ( -
-
-
- image deez nuts -
-
-

- {items.media.title.romaji} -

-

- Episodes {items.progress} - {items.media.episodes} -

- {item.name === "Watching" && ( - - )} -
-
-
- ); - })} -
-
- ); - })} - {/*

Paused

-
- {media[1].entries.map((item, index) => { - return ( -
-
-
- image deez nuts -
-
-

- {item.media.title.romaji} -

-

- Episodes {item.progress} - {item.media.episodes} -

-
-
-
- ); - })} -
-

Dropped

-
- {media[2].entries.map((item, index) => { - return ( -
-
-
- image deez nuts -
-
-

- {item.media.title.romaji} -

-

- Episodes {item.progress} - {item.media.episodes} -

-
-
-
- ); - })} -
*/} -
- )} - Home - - ); -} -- cgit v1.2.3