feat/loading-state #31
@ -6,6 +6,7 @@ import { useMarkContentAsRead } from "@/api/generated/user-interaction/user-inte
|
|||||||
import { ThemeToggle } from "@/components/ThemeToggle.tsx";
|
import { ThemeToggle } from "@/components/ThemeToggle.tsx";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useReadingTracker } from "@/features/chapter/hooks/useReadingTracker.ts";
|
import { useReadingTracker } from "@/features/chapter/hooks/useReadingTracker.ts";
|
||||||
|
import { MangaLoadingState } from "@/components/MangaLoadingState.tsx";
|
||||||
|
|
||||||
const Chapter = () => {
|
const Chapter = () => {
|
||||||
const { setCurrentChapterPage, getCurrentChapterPage } = useReadingTracker();
|
const { setCurrentChapterPage, getCurrentChapterPage } = useReadingTracker();
|
||||||
@ -109,6 +110,14 @@ const Chapter = () => {
|
|||||||
}
|
}
|
||||||
}, [infiniteScroll]);
|
}, [infiniteScroll]);
|
||||||
|
|
||||||
|
if (isLoading) {
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen items-center justify-center bg-background">
|
||||||
|
<MangaLoadingState />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!data?.data) {
|
if (!data?.data) {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen items-center justify-center bg-background">
|
<div className="flex min-h-screen items-center justify-center bg-background">
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { Skeleton } from "@/components/ui/skeleton.tsx";
|
|||||||
import { useUIState } from "@/contexts/UIStateContext.tsx";
|
import { useUIState } from "@/contexts/UIStateContext.tsx";
|
||||||
import { FilterSidebar } from "@/features/home/components/FilterSidebar.tsx";
|
import { FilterSidebar } from "@/features/home/components/FilterSidebar.tsx";
|
||||||
import { MangaGrid } from "@/features/home/components/MangaGrid.tsx";
|
import { MangaGrid } from "@/features/home/components/MangaGrid.tsx";
|
||||||
import { MangaLoadingState } from "@/features/home/components/MangaLoadingState.tsx";
|
import { MangaLoadingState } from "@/components/MangaLoadingState.tsx";
|
||||||
import { SortDropdown } from "@/features/home/components/SortDropdown.tsx";
|
import { SortDropdown } from "@/features/home/components/SortDropdown.tsx";
|
||||||
import { useDynamicPageSize } from "@/hooks/useDynamicPageSize.ts";
|
import { useDynamicPageSize } from "@/hooks/useDynamicPageSize.ts";
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user