From 06b2adcd10811b92b079294dbdab65727ff2015b Mon Sep 17 00:00:00 2001 From: real-zephex Date: Wed, 29 May 2024 10:01:52 +0530 Subject: =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf(deps):=20upgrade=20to=20react?= =?UTF-8?q?=2019=20and=20next=20js=2015,=20add=20loading=20screen,=20drop?= =?UTF-8?q?=20mangas=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/anime/[id]/page.jsx | 5 +- src/app/anime/components/search_results.jsx | 5 +- src/app/anime/loading.jsx | 15 ++ src/app/kdrama/components/searchFormatter.jsx | 5 +- src/app/kdrama/loading.jsx | 15 ++ src/app/layout.jsx | 17 +- src/app/loading.jsx | 15 ++ src/app/manga/[title]/[id]/[read]/download.jsx | 21 -- src/app/manga/[title]/[id]/[read]/page.jsx | 54 ----- src/app/manga/[title]/[id]/[read]/read.module.css | 61 ------ src/app/manga/[title]/[id]/buttons.jsx | 59 ------ src/app/manga/[title]/[id]/info.module.css | 220 --------------------- src/app/manga/[title]/[id]/page.jsx | 144 -------------- src/app/manga/[title]/page.jsx | 77 -------- src/app/manga/[title]/title.module.css | 105 ---------- src/app/manga/cacher.js | 32 --- .../manga/history/continueWatching/cw.module.css | 75 ------- src/app/manga/history/continueWatching/page.jsx | 70 ------- src/app/manga/history/storeData.js | 28 --- src/app/manga/loading.jsx | 9 - src/app/manga/loading.module.css | 22 --- src/app/manga/manga.module.css | 73 ------- src/app/manga/page.jsx | 19 -- src/app/manga/searchBar.jsx | 43 ---- src/app/movies/components/searchFormatter.jsx | 6 +- src/app/movies/loading.jsx | 15 ++ src/app/themeManager.jsx | 27 +++ .../components/seriesSearchFormatter.jsx | 2 + src/app/web-series/loading.jsx | 15 ++ 29 files changed, 132 insertions(+), 1122 deletions(-) create mode 100644 src/app/anime/loading.jsx create mode 100644 src/app/kdrama/loading.jsx create mode 100644 src/app/loading.jsx delete mode 100644 src/app/manga/[title]/[id]/[read]/download.jsx delete mode 100644 src/app/manga/[title]/[id]/[read]/page.jsx delete mode 100644 src/app/manga/[title]/[id]/[read]/read.module.css delete mode 100644 src/app/manga/[title]/[id]/buttons.jsx delete mode 100644 src/app/manga/[title]/[id]/info.module.css delete mode 100644 src/app/manga/[title]/[id]/page.jsx delete mode 100644 src/app/manga/[title]/page.jsx delete mode 100644 src/app/manga/[title]/title.module.css delete mode 100644 src/app/manga/cacher.js delete mode 100644 src/app/manga/history/continueWatching/cw.module.css delete mode 100644 src/app/manga/history/continueWatching/page.jsx delete mode 100644 src/app/manga/history/storeData.js delete mode 100644 src/app/manga/loading.jsx delete mode 100644 src/app/manga/loading.module.css delete mode 100644 src/app/manga/manga.module.css delete mode 100644 src/app/manga/page.jsx delete mode 100644 src/app/manga/searchBar.jsx create mode 100644 src/app/movies/loading.jsx create mode 100644 src/app/themeManager.jsx create mode 100644 src/app/web-series/loading.jsx (limited to 'src') diff --git a/src/app/anime/[id]/page.jsx b/src/app/anime/[id]/page.jsx index 4263005..b121400 100644 --- a/src/app/anime/[id]/page.jsx +++ b/src/app/anime/[id]/page.jsx @@ -9,7 +9,10 @@ const AnimeInfoHomepage = async ({ params }) => { const id = params.id; const data = await anime_info(id); - preFetchVideoLinks(data.episodes); + if (data.episodes.length > 50) { + } else { + preFetchVideoLinks(data.episodes); + } return (
{ diff --git a/src/app/anime/loading.jsx b/src/app/anime/loading.jsx new file mode 100644 index 0000000..1ebf039 --- /dev/null +++ b/src/app/anime/loading.jsx @@ -0,0 +1,15 @@ +import { CircularProgress } from "@nextui-org/react"; + +const LoadingScreen = async () => { + return ( +
+ +
+ ); +}; + +export default LoadingScreen; diff --git a/src/app/kdrama/components/searchFormatter.jsx b/src/app/kdrama/components/searchFormatter.jsx index a9e2f42..cc23fa7 100644 --- a/src/app/kdrama/components/searchFormatter.jsx +++ b/src/app/kdrama/components/searchFormatter.jsx @@ -1,4 +1,7 @@ -import { Card, CardHeader, CardBody, Link } from "@nextui-org/react"; +"use server"; + +import { Card, CardHeader, CardBody } from "@nextui-org/react"; +import Link from "next/link"; import Image from "next/image"; import styles from "../../page.module.css"; diff --git a/src/app/kdrama/loading.jsx b/src/app/kdrama/loading.jsx new file mode 100644 index 0000000..4b403db --- /dev/null +++ b/src/app/kdrama/loading.jsx @@ -0,0 +1,15 @@ +import { CircularProgress } from "@nextui-org/react"; + +const LoadingScreen = async () => { + return ( +
+ +
+ ); +}; + +export default LoadingScreen; diff --git a/src/app/layout.jsx b/src/app/layout.jsx index 9673001..043b18d 100644 --- a/src/app/layout.jsx +++ b/src/app/layout.jsx @@ -3,10 +3,12 @@ import Header from "./components/header/header"; import Footer from "./components/footer/page"; import { SpeedInsights } from "@vercel/speed-insights/next"; import { Analytics } from "@vercel/analytics/react"; -import { NextUIProvider } from "@nextui-org/react"; -import { ThemeProvider as NextThemesProvider } from "next-themes"; +// import { NextUIProvider } from "@nextui-org/react"; +// import { ThemeProvider as NextThemesProvider } from "next-themes"; import { lexend } from "../../config/fonts"; +import { Providers } from "./themeManager"; + export const metadata = { title: "Dramalama", description: @@ -59,12 +61,17 @@ export default function RootLayout({ children }) { - + {/*
-
{children}
+ {children} - + */} + + +
+ {children} + ); diff --git a/src/app/loading.jsx b/src/app/loading.jsx new file mode 100644 index 0000000..2f12723 --- /dev/null +++ b/src/app/loading.jsx @@ -0,0 +1,15 @@ +import { CircularProgress } from "@nextui-org/react"; + +const LoadingScreen = async () => { + return ( +
+ +
+ ); +}; + +export default LoadingScreen; diff --git a/src/app/manga/[title]/[id]/[read]/download.jsx b/src/app/manga/[title]/[id]/[read]/download.jsx deleted file mode 100644 index bddf6d3..0000000 --- a/src/app/manga/[title]/[id]/[read]/download.jsx +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; - -import styles from "./read.module.css"; - -export default function DownloadManga({ chapterId: id }) { - return ( - - ); -} diff --git a/src/app/manga/[title]/[id]/[read]/page.jsx b/src/app/manga/[title]/[id]/[read]/page.jsx deleted file mode 100644 index a2b2555..0000000 --- a/src/app/manga/[title]/[id]/[read]/page.jsx +++ /dev/null @@ -1,54 +0,0 @@ -import styles from "./read.module.css"; -import Image from "next/image"; - -export default async function Read({ params }) { - const chapterId = params.read; - const results = await getPages(chapterId); - const image_base_url = results.baseUrl + "/data/" + results.chapter.hash; - - if (results.length === 0) { - return ( -
-

- This chapter has no content. Please check the next chapter. -

-
- ); - } - - let images = []; - for (var i = 0; i < results.chapter.data.length; i++) { - var imgUrl = image_base_url + "/" + results.chapter.data[i]; - images.push(imgUrl); - } - - return ( -
-
-

Total pages: {images.length}

- {images && - images.map((item, index) => ( -
- Pages -

Page: {index + 1}

-
- ))} -
-
- ); -} - -async function getPages(id) { - const res = await fetch(`https://api.mangadex.org/at-home/server/${id}`); - const data = await res.json(); - return data; -} diff --git a/src/app/manga/[title]/[id]/[read]/read.module.css b/src/app/manga/[title]/[id]/[read]/read.module.css deleted file mode 100644 index 2c7f964..0000000 --- a/src/app/manga/[title]/[id]/[read]/read.module.css +++ /dev/null @@ -1,61 +0,0 @@ -.Main { - margin: 65px auto; -} - -.Image { - display: flex; - flex-direction: column; - align-items: center; - margin: 10px auto; -} - -.Image img { - height: auto; - background-color: #272727; - padding: 5px; -} - -.ImageContainer p { - text-align: center; - color: white; - font-family: "Atkinson Hyperlegible", serif; - font-size: 16px; - margin: 5px; -} - -.NotFound { - text-align: center; - color: white; - font-family: "Atkinson Hyperlegible", serif; - font-size: 20px; -} - -.DownloadMain { - text-align: center; -} - -.DownloadMain button { - border: none; - outline: none; - border-radius: 5px; - padding: 5px; - font-family: "Atkinson Hyperlegible", serif; - font-size: 16px; - background-color: var(--light-green); - cursor: pointer; -} - -.DownloadMain button:hover { - background-color: var(--pastel-red); -} - -@media screen and (max-width: 768px) { - .ImageContainer img { - width: 95%; - align-items: center; - } - - .Image { - width: 100%; - } -} diff --git a/src/app/manga/[title]/[id]/buttons.jsx b/src/app/manga/[title]/[id]/buttons.jsx deleted file mode 100644 index 6c419bf..0000000 --- a/src/app/manga/[title]/[id]/buttons.jsx +++ /dev/null @@ -1,59 +0,0 @@ -"use client"; - -import styles from "./info.module.css"; -import Link from "next/link"; -import { storeLocal } from "../../history/storeData"; - -export default function Buttons({ content: data }) { - let hasValidLinks = false; - function store_to_local(title, chapter, volume, image, id, id2) { - let data = { - title: title, - chapter: chapter, - volume: volume, - image: image, - id: id, - mangaId: id2, - }; - storeLocal(data); - } - - return ( -
- {data.chapters && - data.chapters.map((item, index) => { - if (item.pages !== 0) { - hasValidLinks = true; - return ( - { - store_to_local( - data.title.english || data.title.romaji, - parseInt(item.chapterNumber), - parseInt(item.volumeNumber), - data.image, - item.id, - data.id - ); - }} - > - - - ); - } - })} - {!hasValidLinks && ( -

Links not found

- )} -
- ); -} diff --git a/src/app/manga/[title]/[id]/info.module.css b/src/app/manga/[title]/[id]/info.module.css deleted file mode 100644 index 0420401..0000000 --- a/src/app/manga/[title]/[id]/info.module.css +++ /dev/null @@ -1,220 +0,0 @@ -.MangaInfoContainer { - margin: 60px auto; -} - -.MangaHero { - display: flex; - flex-direction: column; - justify-content: center; -} - -.TitleContainer { - display: flex; - justify-content: space-between; - align-items: center; - padding: 5px; - background-color: #2c2c2c9c; - backdrop-filter: blur(5px); -} - -.TitleContainer p { - font-size: 40px; - font-weight: 700; -} - -.TitleContainer img { - border-radius: 10px; - margin-left: 5px; -} - -.MangaDescription { - color: white; - max-width: 98%; - margin: -10px auto; -} - -.Description h2 { - color: gray; -} - -.Description p { - margin-top: -10px; -} - -.MangaReleaseYear { - margin-top: 10px; -} - -.GenreContainer { - margin-top: 5px; - display: flex; - align-items: center; -} - -.GenreText { - color: var(--neon-green); -} - -.GenreContainer { - margin-top: 10px; -} - -.genres { - display: flex; - align-items: center; - overflow-x: auto; -} - -.MangaGenre { - background-color: #5f5f5f5d; - border-radius: 5px; - padding: 2px 5px; - cursor: pointer; - margin: 2px; -} - -.MangaRatings { - display: flex; - margin-top: 10px; -} - -.MangaRatings span { - margin-right: 2px; - margin-left: 2px; - color: var(--light-green); -} - -.CharactersContainer { - max-width: 98%; - margin: 20px auto; -} - -.CharactersContainer h2 { - color: gray; -} - -.Character { - display: flex; - flex-direction: row; - overflow-x: auto; - margin-top: -10px; -} - -.Character::-webkit-scrollbar { - height: 5px; -} - -.Character::-webkit-scrollbar-thumb { - background-color: #31363f; - border-radius: 5px; -} - -.CharacterEntry { - display: flex; - flex-direction: column; - align-items: center; - width: auto; - margin: 5px; -} - -.CharacterEntry p { - margin: 10px auto; - text-align: center; - width: 110px; - color: white; -} - -.CharacterEntry img { - border-radius: 10px; -} - -/* Chapters Buttons */ - -.Chapters { - display: flex; - align-items: center; - justify-content: space-between; - max-width: 90%; - margin: 20px auto; -} - -.ChapterTitle { - color: white; - font-size: 32px; -} - -.ChapterContainer { - width: 50dvw; - text-align: center; - height: 300px; - overflow-y: auto; -} - -.ChapterContainer::-webkit-scrollbar { - width: 5px; - height: 0px; -} - -.ChapterContainer::-webkit-scrollbar-thumb { - background-color: #31363f; - border-radius: 5px; -} - -.ChapterContainer button { - width: 130px; - height: auto; - padding: 10px; - margin: 5px; - border-radius: 5px; - font-size: 16px; - border: none; - outline: none; - color: white; - background-color: #3d3d3d; - cursor: pointer; - transition: background-color 100ms ease-in-out; - font-family: "Lexend Deca"; -} - -.ChapterContainer button p { - margin: 2px; -} - -.ChapterContainer button:hover { - background-color: #1f1f1f; - transition: background-color 50ms ease-in; -} - -.ChapterContainer button:focus { - opacity: 0.7; - transition: transform 0.2s linear; - background-color: var(--pastel-red); - transform: scale(0.9); -} - -.linksNotFound { - color: white; - font-size: 18px; - display: flex; - justify-content: center; - align-items: center; - height: 85%; -} - -@media screen and (max-width: 768px) { - .MangaInfoContainer { - max-width: 100%; - } - - .TitleContainer p { - font-size: 28px; - } - - .ChapterContainer button { - width: 120px; - } - - .ChapterContainer button p { - font-size: 14px; - } -} diff --git a/src/app/manga/[title]/[id]/page.jsx b/src/app/manga/[title]/[id]/page.jsx deleted file mode 100644 index 37fb3e5..0000000 --- a/src/app/manga/[title]/[id]/page.jsx +++ /dev/null @@ -1,144 +0,0 @@ -import styles from "./info.module.css"; -import Image from "next/image"; -import Buttons from "./buttons"; -import { redirect } from "next/navigation"; -import { FaStar } from "react-icons/fa"; -import { PreFetchChaterLinks } from "../../cacher"; - -export default async function MangaInfo({ params }) { - const id = params.id; - const data = await getMangaInfo(id); - - if (data.message) { - redirect("/404"); - } - - let description; - if (!data.description) { - description = - "Sorry but description for this particular manga was not found."; - } else { - description = data.description.split("
")[0]; - } - - PreFetchChaterLinks(data.chapters); - - return ( -
- {data && ( -
-
-
-

- {data.title["english"] || data.title["romaji"]} -

- Manga Poster -
-
- -
-
-

Description

-

{description}

-
- -
- - Started on: {data.startDate["day"]}- - {data.startDate["month"]}- - {data.startDate["year"]} - - - | - - - Ended on: {data.endDate["day"]}- - {data.endDate["month"]}-{data.endDate["year"]} - -
- -
- Genres: -
- {data.genres && - data.genres.map((item, index) => ( - - {item} - - ))} -
-
- -
- Ratings: {data.rating / 10} - - - -
-
- -
-

Characters

-
- {data.characters && - data.characters.map((item, index) => ( -
- Character Poster -

- {item.name.full} ({item.role}) -

-
- ))} -
-
-
-

- Chapters & Volumes -

- -
-
- )} -
- ); -} - -async function getMangaInfo(id) { - const res = await fetch( - `https://consumet-jade.vercel.app/meta/anilist-manga/info/${id}?provider=mangadex`, - { next: { revalidate: 21600 } } - ); - const data = await res.json(); - return data; -} diff --git a/src/app/manga/[title]/page.jsx b/src/app/manga/[title]/page.jsx deleted file mode 100644 index 689042b..0000000 --- a/src/app/manga/[title]/page.jsx +++ /dev/null @@ -1,77 +0,0 @@ -import styles from "./title.module.css"; -import Image from "next/image"; -import Link from "next/link"; -import { PreFetchMangaInfo } from "../cacher"; - -export default async function MangaInfo({ params }) { - const title = params.title; - const data = await GetSearchedAnime(title); - - PreFetchMangaInfo(data); - - return ( -
-
- {title && ( -
-

Searched for: {decodeURIComponent(title)}

-
- )} - {data && - data.results.map(async (item, index) => { - let desc = item.description || ""; // Ensure desc is not null - if (desc === "") { - desc = "Not found"; // If desc is empty, set it to "Not found" - } - return ( - -
- Manga Poster -
-

- {item.title["english"] || - item.title["romaji"]} -

-

- {desc.includes && - desc.includes(" -

- Status: {item.status || "not sure"} -

-

- Chapters:{" "} - {item.totalChapters || "not sure"} -

-

- Volumes:{" "} - {item.volumes || "not sure"} -

-
-
- - ); - })} -
-
- ); -} - -async function GetSearchedAnime(title) { - const res = await fetch( - "https://consumet-jade.vercel.app/meta/anilist-manga/" + title - ); - const data = await res.json(); - return data; -} diff --git a/src/app/manga/[title]/title.module.css b/src/app/manga/[title]/title.module.css deleted file mode 100644 index 7ed09bd..0000000 --- a/src/app/manga/[title]/title.module.css +++ /dev/null @@ -1,105 +0,0 @@ -.Main { - max-width: 95%; - margin: 60px auto; -} - -.MangaContainer { - display: flex; - flex-direction: column; -} - -.SearchedFor { - color: white; - text-align: center; - font-size: 26px; -} - -.MangaEntries { - display: flex; - flex-direction: row; - margin: 0px 10px 10px 10px; - padding: 10px; - border-style: solid; - border-radius: 0.5rem; - border-color: #363636 #474747; - border-width: 0.1rem; - align-items: center; - cursor: pointer; - transition: opacity 200ms linear, transform 200ms linear; -} - -/* THIS WORKS*/ -.MangaContainer:hover .MangaEntries { - opacity: 0.5; -} - -.MangaContainer:hover .MangaEntries:hover { - opacity: 1; - transform: scale(1.01); -} - -.MangaInfo { - color: white; - margin-left: 20px; -} - -.MangaEntries img { - border-radius: 0.5rem; -} - -.MangaTitle { - margin: 0px; - font-size: 28px; - color: var(--neon-green); -} - -.MangaDescription { - margin: 0.5rem 0 0.5rem 0; -} - -.MangaStatus { - color: var(--soft-purple); - margin: 0px; -} - -.MangaVolume { - margin: 0px; - color: #ffacac; -} - -.MangaChapters { - color: #ffebb4; - margin: 0.3rem 0 0.3rem 0; -} - -@media screen and (max-width: 768px) { - .Main { - max-width: 100%; - } - - .MangaEntries { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; - } - - .MangaEntries img { - width: auto; - height: auto; - border-radius: 0.3rem; - background-color: #121212; - padding: 0.2rem; - } - - .MangaTitle { - font-weight: 600; - } - - .MangaDescription { - max-height: 7.5rem; - overflow: auto; - } - -} \ No newline at end of file diff --git a/src/app/manga/cacher.js b/src/app/manga/cacher.js deleted file mode 100644 index 6059674..0000000 --- a/src/app/manga/cacher.js +++ /dev/null @@ -1,32 +0,0 @@ -// This function pre-fetches all the chapter pages links for a manga in the background -"use server"; - -export async function PreFetchChaterLinks(data) { - try { - const fetchPromises = data.map(async (element) => { - const link = `https://consumet-jade.vercel.app/meta/anilist-manga/read?chapterId=${element.id}&provider=mangadex`; - await fetch(link, { cache: "force-cache" }); - }); - - await Promise.all(fetchPromises); - console.log("Chapter links pre-fetched successfully!"); - } catch (error) { - console.error( - "Error occurred while pre-fetching chapter links:", - error - ); - } -} - -export async function PreFetchMangaInfo(data) { - try { - const fetchPromises = data.results.map(async (element) => { - const link = `https://consumet-jade.vercel.app/meta/anilist-manga/${element.id}?provider=mangadex`; - await fetch(link, { next: { revalidate: 86400 } }); - }); - await Promise.all(fetchPromises); - console.log("Manga info pre-fetched successfully!"); - } catch (error) { - console.error("error", error); - } -} diff --git a/src/app/manga/history/continueWatching/cw.module.css b/src/app/manga/history/continueWatching/cw.module.css deleted file mode 100644 index e83be6b..0000000 --- a/src/app/manga/history/continueWatching/cw.module.css +++ /dev/null @@ -1,75 +0,0 @@ -.main { - width: 99%; - margin: 80px auto; -} - -.mainText { - color: var(--light-green); - font-size: 24px; -} - -.animeContainer { - font-size: 18px; - margin: 0px; -} - -.animeEntry { - display: flex; - align-items: center; - justify-content: space-between; - padding: 5px; - margin-bottom: 0.5rem; - border-radius: 1rem; - background-color: #1f1f1f; -} - -.animeEntry img { - width: 10%; - height: auto; - border-radius: 0.8rem; -} - -.titleContainer { - color: white; - margin-left: 0.2rem; -} - -.titleContainer h3 { - margin: 0px; -} - -.EpisodeCount { - color: var(--soft-purple); - margin: 0px; -} - -.date { - color: var(--neon-yellow); - margin: 0px; -} - -.redirects { - margin: 5px 0 0 0; -} - -.redirects button { - outline: none; - border: none; - margin-right: 0.4rem; - border-radius: 0.2rem; - padding: 0.2rem; - font-family: "Lexend Deca", serif; - background-color: #303030; - color: white; - cursor: pointer; -} - -@media screen and (max-width: 768px) { - .animeContainer { - font-size: 14px; - } - - .animeEntry img { - width: 35%; - } -} diff --git a/src/app/manga/history/continueWatching/page.jsx b/src/app/manga/history/continueWatching/page.jsx deleted file mode 100644 index 8c5f651..0000000 --- a/src/app/manga/history/continueWatching/page.jsx +++ /dev/null @@ -1,70 +0,0 @@ -"use client"; - -import React, { useState, useEffect } from "react"; -import Image from "next/image"; -import styles from "./cw.module.css"; -import Link from "next/link"; - -const ContinueWatching = () => { - const [localItems, setLocalItems] = useState(null); - - useEffect(() => { - const newData = get_local(); - setLocalItems(newData); - }, []); // Empty dependency array means this effect runs only once after the initial render - - function get_local() { - try { - const data = localStorage.getItem("mangaData"); - return JSON.parse(data); - } catch (error) { - console.log("error", error); - return false; - } - } - - return ( -
-

Continue Reading

- {localItems && ( -
- {localItems.watchHis && - localItems.watchHis.map((item, index) => ( -
-
-

{item.title}

-

- Currently reading: Volume {item.volume}{" "} - Chapter {item.chapter} -

-
- - - - - - -
-
- Continue anime poster -
- ))} -
- )} -
- ); -}; - -export default ContinueWatching; diff --git a/src/app/manga/history/storeData.js b/src/app/manga/history/storeData.js deleted file mode 100644 index 8d82a97..0000000 --- a/src/app/manga/history/storeData.js +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -export function storeLocal(watchData) { - const jsonData = localStorage.getItem("mangaData"); - const dataObject = jsonData ? JSON.parse(jsonData) : {}; - - if (!dataObject.watchHis) { - dataObject.watchHis = []; - } - - let found = false; - dataObject.watchHis.forEach((element) => { - if (element.title === watchData.title) { - let chapter = watchData.chapter; - let volume = watchData.volume; - element.chapter = chapter; - element.volume = volume; - found = true; - } - }); - - if (!found) { - dataObject.watchHis.push(watchData); - } - - let updatedData = JSON.stringify(dataObject); - localStorage.setItem("mangaData", updatedData); -} diff --git a/src/app/manga/loading.jsx b/src/app/manga/loading.jsx deleted file mode 100644 index f96f0dc..0000000 --- a/src/app/manga/loading.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import styles from "./loading.module.css"; - -export default function Loading() { - return ( -
-
-
- ); -} diff --git a/src/app/manga/loading.module.css b/src/app/manga/loading.module.css deleted file mode 100644 index d52e913..0000000 --- a/src/app/manga/loading.module.css +++ /dev/null @@ -1,22 +0,0 @@ -.Main { - height: 100dvh; - width: 100dvw; - display: flex; - justify-content: center; - align-items: center; -} - -.LoadingContainer { - width: 50px; - height: 50px; - border-radius: 50%; - border: 8px solid; - border-color: #f4f4f4 #0000; - animation: s1 1s infinite; -} - -@keyframes s1 { - to { - transform: rotate(0.5turn); - } -} diff --git a/src/app/manga/manga.module.css b/src/app/manga/manga.module.css deleted file mode 100644 index cd18c0a..0000000 --- a/src/app/manga/manga.module.css +++ /dev/null @@ -1,73 +0,0 @@ -.Main { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100vh; -} - -.searchMain { - display: flex; - align-items: center; - justify-content: center; -} - -.MangaImage { - width: auto; - height: auto; -} - -.SearchBar { - display: flex; - align-items: center; - background: #121212; - padding: 0.2rem; - border-radius: 0.5rem; - width: 20dvw; - margin-top: 0.3rem; -} - -.histButton button { - margin: 0px 5px 0px 5px; - border-radius: 0.2rem; - padding: 0.4rem; - border: none; - outline: none; - font-family: "Lexend Deca", serif; - background: #1f1f1f; - color: white; - cursor: pointer; -} - -.SearchBar input { - background: none; - outline: none; - border: none; - margin-left: 5px; - padding: 4px; - width: 100%; - color: white; - font-family: "Lexend Deca", serif; - font-size: 16px; -} - -.SearchBar input::placeholder { - color: rgb(71, 71, 71); -} - -@media screen and (max-width: 768px) { - .SearchBar { - width: 40vw; - } -} - -@media screen and (max-width: 425px) { - .MangaImage { - width: 100%; - height: auto; - } - - .SearchBar { - width: 60dvw; - } -} \ No newline at end of file diff --git a/src/app/manga/page.jsx b/src/app/manga/page.jsx deleted file mode 100644 index ff1731d..0000000 --- a/src/app/manga/page.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import styles from "./manga.module.css"; -import Image from "next/image"; -import SearchBar from "./searchBar"; - -export default async function Manga() { - return ( -
- Manga Intro Image - -
- ); -} diff --git a/src/app/manga/searchBar.jsx b/src/app/manga/searchBar.jsx deleted file mode 100644 index 76928c3..0000000 --- a/src/app/manga/searchBar.jsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; - -import { FaSearch } from "react-icons/fa"; -import styles from "./manga.module.css"; -import { useState } from "react"; -import { useRouter } from "next/navigation"; -import Link from "next/link"; - -export default function SearchBar() { - const router = useRouter(); - - const [title, setMangaTitle] = useState(""); - - return ( -
-
- - setMangaTitle(e.target.value)} - onKeyDown={(event) => { - if ( - (event.key === "Enter" || - event.code === 13 || - event.code === "Enter") && - title !== "" - ) { - router.push(`/manga/${title}`); - } - }} - > -
-
- - - -
-
- ); -} diff --git a/src/app/movies/components/searchFormatter.jsx b/src/app/movies/components/searchFormatter.jsx index dc6afb2..ded6022 100644 --- a/src/app/movies/components/searchFormatter.jsx +++ b/src/app/movies/components/searchFormatter.jsx @@ -1,6 +1,8 @@ -import { Card, CardHeader, CardBody, Link } from "@nextui-org/react"; -import Image from "next/image"; +"use server"; +import { Card, CardHeader, CardBody } from "@nextui-org/react"; +import Image from "next/image"; +import Link from "next/link"; import styles from "../../page.module.css"; const MovieSearchFormatter = async (data) => { diff --git a/src/app/movies/loading.jsx b/src/app/movies/loading.jsx new file mode 100644 index 0000000..fecdddb --- /dev/null +++ b/src/app/movies/loading.jsx @@ -0,0 +1,15 @@ +import { CircularProgress } from "@nextui-org/react"; + +const LoadingScreen = async () => { + return ( +
+ +
+ ); +}; + +export default LoadingScreen; diff --git a/src/app/themeManager.jsx b/src/app/themeManager.jsx new file mode 100644 index 0000000..f33f7b3 --- /dev/null +++ b/src/app/themeManager.jsx @@ -0,0 +1,27 @@ +// app/providers.tsx +"use client"; + +import { useEffect, useState } from "react"; +import { NextUIProvider } from "@nextui-org/react"; +import { ThemeProvider as NextThemesProvider } from "next-themes"; + +export function Providers({ children }) { + const [isMounted, setIsMounted] = useState(false); + + useEffect(() => { + setIsMounted(true); + }, []); + + if (!isMounted) { + // Render nothing on the server, ensuring HTML consistency + return null; + } + + return ( + + + {children} + + + ); +} diff --git a/src/app/web-series/components/seriesSearchFormatter.jsx b/src/app/web-series/components/seriesSearchFormatter.jsx index 408e7c0..ada00fb 100644 --- a/src/app/web-series/components/seriesSearchFormatter.jsx +++ b/src/app/web-series/components/seriesSearchFormatter.jsx @@ -1,3 +1,5 @@ +"use server"; + import { Card, CardHeader, CardBody } from "@nextui-org/react"; import Link from "next/link"; import Image from "next/image"; diff --git a/src/app/web-series/loading.jsx b/src/app/web-series/loading.jsx new file mode 100644 index 0000000..63ffdfc --- /dev/null +++ b/src/app/web-series/loading.jsx @@ -0,0 +1,15 @@ +import { CircularProgress } from "@nextui-org/react"; + +const LoadingScreen = async () => { + return ( +
+ +
+ ); +}; + +export default LoadingScreen; -- cgit v1.2.3