diff --git a/app/components/Discovery/CollectionsOfTheWeek.tsx b/app/components/Discovery/CollectionsOfTheWeek.tsx
new file mode 100644
index 0000000..a132684
--- /dev/null
+++ b/app/components/Discovery/CollectionsOfTheWeek.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { ENDPOINTS } from "#/api/config";
+import { useSWRfetcher } from "#/api/utils";
+import useSWR from "swr";
+import { CollectionCourusel } from "../CollectionCourusel/CollectionCourusel";
+import { useUserStore } from "#/store/auth";
+
+export const CollectionsOfTheWeek = () => {
+ const token = useUserStore((state) => state.token);
+ const { data, isLoading, error } = useSWR(
+ `${ENDPOINTS.discover.collections}/-1?previous_page=0&where=2&sort=4${token ? `&token=${token}` : ""}`,
+ useSWRfetcher,
+ {
+ revalidateOnFocus: false,
+ revalidateIfStale: false,
+ revalidateOnReconnect: false,
+ }
+ );
+
+ if (error) return <>>;
+ if (isLoading) return <>>;
+
+ return (
+
+ );
+};
diff --git a/app/components/Discovery/DiscussingTodayCarousel.tsx b/app/components/Discovery/DiscussingToday.tsx
similarity index 74%
rename from app/components/Discovery/DiscussingTodayCarousel.tsx
rename to app/components/Discovery/DiscussingToday.tsx
index 7af3de7..71a4692 100644
--- a/app/components/Discovery/DiscussingTodayCarousel.tsx
+++ b/app/components/Discovery/DiscussingToday.tsx
@@ -7,7 +7,7 @@ import Link from "next/link";
import { PosterWithStuff } from "../ReleasePoster/PosterWithStuff";
import useSWR from "swr";
-export const DiscussingTodayCarousel = () => {
+export const DiscussingToday = () => {
const token = useUserStore((state) => state.token);
const { data, isLoading, error } = useSWR(
`${ENDPOINTS.discover.discussing}${token ? `?token=${token}` : ""}`,
@@ -19,14 +19,7 @@ export const DiscussingTodayCarousel = () => {
}
);
- if (error)
- return (
-
-
-
Произошла ошибка загрузки обсуждаемых релизов
-
-
- );
+ if (error) return <>>;
if (isLoading) return <>>;
return (
diff --git a/app/components/Discovery/InterestingCarousel.tsx b/app/components/Discovery/InterestingCarousel.tsx
index d6c4c41..fa4e366 100644
--- a/app/components/Discovery/InterestingCarousel.tsx
+++ b/app/components/Discovery/InterestingCarousel.tsx
@@ -22,14 +22,7 @@ export const InterestingCarousel = () => {
}
);
- if (error)
- return (
-
-
-
Произошла ошибка загрузки интересных релизов
-
-
- );
+ if (error) return <>>;
if (isLoading) return <>>;
return (
@@ -45,12 +38,6 @@ export const InterestingCarousel = () => {
prevEl: ".swiper-button-prev",
}}
allowTouchMove={true}
- breakpoints={{
- 1800: {
- initialSlide: 1,
- centeredSlides: true,
- },
- }}
className={Styles.swiper}
>
{data.content.map((item) => {
diff --git a/app/components/Discovery/WatchingNowCarousel.tsx b/app/components/Discovery/WatchingNowCarousel.tsx
new file mode 100644
index 0000000..0bb20a1
--- /dev/null
+++ b/app/components/Discovery/WatchingNowCarousel.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { ENDPOINTS } from "#/api/config";
+import { useSWRfetcher } from "#/api/utils";
+import { useUserStore } from "#/store/auth";
+import { ReleaseCourusel } from "../ReleaseCourusel/ReleaseCourusel";
+import useSWR from "swr";
+
+export const WatchingNowCarousel = () => {
+ const token = useUserStore((state) => state.token);
+ const { data, isLoading, error } = useSWR(
+ `${ENDPOINTS.discover.watching}/0${token ? `?token=${token}` : ""}`,
+ useSWRfetcher,
+ {
+ revalidateOnFocus: false,
+ revalidateIfStale: false,
+ revalidateOnReconnect: false,
+ }
+ );
+
+ if (error) return <>>;
+ if (isLoading) return <>>;
+
+ return
;
+};
diff --git a/app/components/ReleaseCourusel/ReleaseCourusel.tsx b/app/components/ReleaseCourusel/ReleaseCourusel.tsx
index 503c814..3fa90a1 100644
--- a/app/components/ReleaseCourusel/ReleaseCourusel.tsx
+++ b/app/components/ReleaseCourusel/ReleaseCourusel.tsx
@@ -40,12 +40,6 @@ export const ReleaseCourusel = (props: {
prevEl: ".swiper-button-prev"
}}
allowTouchMove={true}
- breakpoints={{
- 1800: {
- initialSlide: 2,
- centeredSlides: true
- }
- }}
className={Styles.swiper}
>
{props.content.map((release) => {
diff --git a/app/pages/Discover.tsx b/app/pages/Discover.tsx
index 841a6d7..b36e430 100644
--- a/app/pages/Discover.tsx
+++ b/app/pages/Discover.tsx
@@ -1,6 +1,8 @@
"use client";
-import { DiscussingTodayCarousel } from "#/components/Discovery/DiscussingTodayCarousel";
+import { CollectionsOfTheWeek } from "#/components/Discovery/CollectionsOfTheWeek";
+import { DiscussingToday } from "#/components/Discovery/DiscussingToday";
import { InterestingCarousel } from "#/components/Discovery/InterestingCarousel";
+import { WatchingNowCarousel } from "#/components/Discovery/WatchingNowCarousel";
import { Button } from "flowbite-react";
export const DiscoverPage = () => {
@@ -25,7 +27,9 @@ export const DiscoverPage = () => {
Фильтр