diff --git a/app/components/Chip/Chip.tsx b/app/components/Chip/Chip.tsx index bd0225c..a7e8e7f 100644 --- a/app/components/Chip/Chip.tsx +++ b/app/components/Chip/Chip.tsx @@ -6,22 +6,26 @@ export const Chip = (props: { devider?: string; bg_color?: string; style?: React.CSSProperties; - className?: string; }) => { return ( -
+
{props.icon_name && ( )} -

+

{props.name} {props.name && props.devider ? props.devider : " "} {props.name_2} diff --git a/app/components/Profile/Profile.ReleaseHistory.tsx b/app/components/Profile/Profile.ReleaseHistory.tsx index b579c11..e17c2d9 100644 --- a/app/components/Profile/Profile.ReleaseHistory.tsx +++ b/app/components/Profile/Profile.ReleaseHistory.tsx @@ -1,29 +1,25 @@ -import { Card, Carousel } from "flowbite-react"; +import { Card, Carousel, RatingStar, Rating } from "flowbite-react"; import type { FlowbiteCarouselIndicatorsTheme, FlowbiteCarouselControlTheme, - CustomFlowbiteTheme, } from "flowbite-react"; -import { ReleaseLink } from "../ReleaseLink/ReleaseLinkUpdate"; +import { ReleaseLink } from "../ReleaseLink/ReleaseLink"; const CarouselIndicatorsTheme: FlowbiteCarouselIndicatorsTheme = { active: { - off: "bg-gray-400/50 hover:bg-gray-200", - on: "bg-gray-200", + off: "bg-gray-300/50 hover:bg-gray-400 dark:bg-gray-400/50 dark:hover:bg-gray-200", + on: "bg-gray-600 dark:bg-gray-200", }, - base: "h-3 w-3 rounded-full max-w-[300px]", + base: "h-3 w-3 rounded-full", wrapper: "absolute bottom-5 left-1/2 flex -translate-x-1/2 space-x-3", }; const CarouselControlsTheme: FlowbiteCarouselControlTheme = { - base: "inline-flex h-8 w-8 items-center justify-center rounded-full group-focus:outline-none group-focus:ring-4 bg-gray-400/30 group-hover:bg-gray-400/60 group-focus:ring-gray-400/70 sm:h-10 sm:w-10", - icon: "h-5 w-5 text-gray-400 sm:h-6 sm:w-6", + base: "inline-flex h-8 w-8 items-center justify-center rounded-full bg-gray-600/30 group-hover:bg-gray-600/50 group-focus:outline-none group-focus:ring-4 group-focus:ring-gray-600 dark:bg-gray-400/30 dark:group-hover:bg-gray-400/60 dark:group-focus:ring-gray-400/70 sm:h-10 sm:w-10", + icon: "h-5 w-5 text-gray-600 dark:text-gray-400 sm:h-6 sm:w-6", }; -const CarouselTheme: CustomFlowbiteTheme["carousel"] = { - root: { - base: "relative h-full w-full max-w-[375px]", - }, +const CarouselTheme = { indicators: CarouselIndicatorsTheme, control: CarouselControlsTheme, }; @@ -32,16 +28,10 @@ export const ProfileReleaseHistory = (props: any) => { return (

Недавно просмотренные

-
+
{props.history.map((release) => { - return ( - - ); + return ; })}
diff --git a/app/components/Profile/Profile.ReleaseRatings.tsx b/app/components/Profile/Profile.ReleaseRatings.tsx index 75af80d..6c6f978 100644 --- a/app/components/Profile/Profile.ReleaseRatings.tsx +++ b/app/components/Profile/Profile.ReleaseRatings.tsx @@ -17,7 +17,6 @@ import { useCallback, useEffect, useState } from "react"; import { ENDPOINTS } from "#/api/config"; import useSWRInfinite from "swr/infinite"; import { Spinner } from "../Spinner/Spinner"; -import { Poster } from "../ReleasePoster/Poster"; const CarouselIndicatorsTheme: FlowbiteCarouselIndicatorsTheme = { active: { @@ -34,9 +33,6 @@ const CarouselControlsTheme: FlowbiteCarouselControlTheme = { }; const CarouselTheme = { - root: { - base: "relative h-full w-full max-w-[700px]", - }, indicators: CarouselIndicatorsTheme, control: CarouselControlsTheme, }; @@ -51,15 +47,19 @@ export const ProfileReleaseRatings = (props: any) => { Посмотреть все
-
+
{props.ratings.map((release) => { return (
-
- -
+

{release.title_ru}

@@ -155,7 +155,7 @@ const ProfileReleaseRatingsModal = (props: { ref={modalRef} > {isLoading && } - {content && content.length > 0 ? + {content && content.length > 0 ? ( content.map((release) => { return (
-
- -
+

{release.title_ru}

@@ -196,7 +200,9 @@ const ProfileReleaseRatingsModal = (props: { ); }) - :

Оценок нет

} + ) : ( +

Оценок нет

+ )}
); diff --git a/app/components/ReleaseCourusel/ReleaseCourusel.tsx b/app/components/ReleaseCourusel/ReleaseCourusel.tsx index 503c814..d7e333a 100644 --- a/app/components/ReleaseCourusel/ReleaseCourusel.tsx +++ b/app/components/ReleaseCourusel/ReleaseCourusel.tsx @@ -1,5 +1,5 @@ "use client"; -import { ReleaseLink } from "../ReleaseLink/ReleaseLinkUpdate"; +import { ReleaseLink } from "../ReleaseLink/ReleaseLink"; import Link from "next/link"; import { Swiper, SwiperSlide } from 'swiper/react'; @@ -42,7 +42,7 @@ export const ReleaseCourusel = (props: { allowTouchMove={true} breakpoints={{ 1800: { - initialSlide: 2, + initialSlide: 1, centeredSlides: true } }} @@ -52,7 +52,7 @@ export const ReleaseCourusel = (props: { return ( diff --git a/app/components/ReleaseInfo/ReleaseInfo.Basics.tsx b/app/components/ReleaseInfo/ReleaseInfo.Basics.tsx index 63a576c..c23cf4f 100644 --- a/app/components/ReleaseInfo/ReleaseInfo.Basics.tsx +++ b/app/components/ReleaseInfo/ReleaseInfo.Basics.tsx @@ -2,7 +2,6 @@ import { Card, Button } from "flowbite-react"; import { useState } from "react"; import Image from "next/image"; import { ReleaseInfoStreaming } from "./ReleaseInfo.LicensedPlatforms"; -import { Poster } from "../ReleasePoster/Poster"; export const ReleaseInfoBasics = (props: { release_id: number; @@ -15,20 +14,14 @@ export const ReleaseInfoBasics = (props: { return ( -
-
-
- - -
- -
+
+

@@ -61,6 +54,7 @@ export const ReleaseInfoBasics = (props: { > {isFullDescription ? "Скрыть" : "Показать полностью"} +

diff --git a/app/components/ReleaseInfo/ReleaseInfo.LicensedPlatforms.tsx b/app/components/ReleaseInfo/ReleaseInfo.LicensedPlatforms.tsx index 25f4d24..6a1c72b 100644 --- a/app/components/ReleaseInfo/ReleaseInfo.LicensedPlatforms.tsx +++ b/app/components/ReleaseInfo/ReleaseInfo.LicensedPlatforms.tsx @@ -23,17 +23,17 @@ export const ReleaseInfoStreaming = (props: { release_id: number }) => { : !(data.content.length > 0) ? "" :
-
+

Официальные источники:

+
{data.content.map((item: any) => { return ( -

{item.name}

+

{item.name}

); })} diff --git a/app/components/ReleaseInfo/ReleaseInfo.Related.tsx b/app/components/ReleaseInfo/ReleaseInfo.Related.tsx index 80a5cac..dbd6c40 100644 --- a/app/components/ReleaseInfo/ReleaseInfo.Related.tsx +++ b/app/components/ReleaseInfo/ReleaseInfo.Related.tsx @@ -1,29 +1,13 @@ "use client"; -import { Card, Carousel, CustomFlowbiteTheme, FlowbiteCarouselControlTheme, FlowbiteCarouselIndicatorsTheme } from "flowbite-react"; -import { ReleaseLink } from "#/components/ReleaseLink/ReleaseLinkUpdate"; +import { Card, Carousel, CustomFlowbiteTheme } from "flowbite-react"; +import { ReleaseLink } from "#/components/ReleaseLink/ReleaseLink"; import Link from "next/link"; -const CarouselIndicatorsTheme: FlowbiteCarouselIndicatorsTheme = { - active: { - off: "bg-gray-400/50 hover:bg-gray-200", - on: "bg-gray-200", - }, - base: "h-3 w-3 rounded-full max-w-[300px]", - wrapper: "absolute bottom-5 left-1/2 flex -translate-x-1/2 space-x-3", -}; - -const CarouselControlsTheme: FlowbiteCarouselControlTheme = { - base: "inline-flex h-8 w-8 items-center justify-center rounded-full group-focus:outline-none group-focus:ring-4 bg-gray-400/30 group-hover:bg-gray-400/60 group-focus:ring-gray-400/70 sm:h-10 sm:w-10", - icon: "h-5 w-5 text-gray-400 sm:h-6 sm:w-6", -}; - const CarouselTheme: CustomFlowbiteTheme["carousel"] = { root: { base: "relative h-full w-full max-w-[300px]", }, - indicators: CarouselIndicatorsTheme, - control: CarouselControlsTheme, }; export const ReleaseInfoRelated = (props: { @@ -55,11 +39,7 @@ export const ReleaseInfoRelated = (props: { }) .map((release: any) => { return ( - + ); })} diff --git a/app/components/ReleaseLink/ReleaseLink.16_9FullImage.tsx b/app/components/ReleaseLink/ReleaseLink.16_9FullImage.tsx new file mode 100644 index 0000000..b62e0ce --- /dev/null +++ b/app/components/ReleaseLink/ReleaseLink.16_9FullImage.tsx @@ -0,0 +1,133 @@ +import Link from "next/link"; +import { sinceUnixDate } from "#/api/utils"; +import { Chip } from "#/components/Chip/Chip"; +import Image from "next/image"; + +const profile_lists = { + // 0: "Не смотрю", + 1: { name: "Смотрю", bg_color: "bg-green-500" }, + 2: { name: "В планах", bg_color: "bg-purple-500" }, + 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, + 4: { name: "Отложено", bg_color: "bg-yellow-500" }, + 5: { name: "Брошено", bg_color: "bg-red-500" }, +}; + +export const ReleaseLink169 = (props: any) => { + const grade = props.grade ? props.grade.toFixed(1) : null; + const profile_list_status = props.profile_list_status; + let user_list = null; + if (profile_list_status != null || profile_list_status != 0) { + user_list = profile_lists[profile_list_status]; + } + return ( + +
+
+ {props.title +
+ {grade ? ( + + ) : ( + "" + )} + {user_list && ( + + )} + {props.status ? ( + + ) : ( + props.status_id != 0 && ( + + ) + )} + + {props.last_view_episode && ( + + )} + {props.category && } + {props.is_favorite && ( +
+ +
+ )} +
+
+
+ {props.genres && ( +

+ {props.genres} +

+ )} +

+ {props.title_ru} +

+
+

+ {`${props.description.slice(0, 125)}${ + props.description.length > 125 ? "..." : "" + }`} +

+
+
+
+ + ); +}; diff --git a/app/components/ReleaseLink/ReleaseLink.16_9Poster.tsx b/app/components/ReleaseLink/ReleaseLink.16_9Poster.tsx new file mode 100644 index 0000000..384c914 --- /dev/null +++ b/app/components/ReleaseLink/ReleaseLink.16_9Poster.tsx @@ -0,0 +1,124 @@ +import Link from "next/link"; +import { sinceUnixDate } from "#/api/utils"; +import { Chip } from "#/components/Chip/Chip"; +import Image from "next/image"; + +const profile_lists = { + // 0: "Не смотрю", + 1: { name: "Смотрю", bg_color: "bg-green-500" }, + 2: { name: "В планах", bg_color: "bg-purple-500" }, + 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, + 4: { name: "Отложено", bg_color: "bg-yellow-500" }, + 5: { name: "Брошено", bg_color: "bg-red-500" }, +}; + +export const ReleaseLink169Poster = (props: any) => { + const grade = props.grade ? props.grade.toFixed(1) : null; + const profile_list_status = props.profile_list_status; + let user_list = null; + if (profile_list_status != null || profile_list_status != 0) { + user_list = profile_lists[profile_list_status]; + } + return ( + +
+
+
+ {props.title +
+
+
+ {props.genres && ( +

+ {props.genres} +

+ )} +

+ {`${props.title_ru.slice(0, 47)}${ + props.title_ru.length > 47 ? "..." : "" + }`} +

+

+ {`${props.description.slice(0, 97)}${ + props.description.length > 97 ? "..." : "" + }`} +

+
+
+ {grade ? : ""} + {user_list && ( + + )} + {props.status ? ( + + ) : ( + props.status_id != 0 && ( + + ) + )} + + {props.last_view_episode && ( + + )} + {props.category && } + {props.is_favorite && ( +
+ +
+ )} +
+
+
+
+ + ); +}; diff --git a/app/components/ReleaseLink/ReleaseLink.16_9Related.tsx b/app/components/ReleaseLink/ReleaseLink.16_9Related.tsx new file mode 100644 index 0000000..aa2959f --- /dev/null +++ b/app/components/ReleaseLink/ReleaseLink.16_9Related.tsx @@ -0,0 +1,136 @@ +import Link from "next/link"; +import { sinceUnixDate } from "#/api/utils"; +import { Chip } from "#/components/Chip/Chip"; +import Image from "next/image"; + +const profile_lists = { + // 0: "Не смотрю", + 1: { name: "Смотрю", bg_color: "bg-green-500" }, + 2: { name: "В планах", bg_color: "bg-purple-500" }, + 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, + 4: { name: "Отложено", bg_color: "bg-yellow-500" }, + 5: { name: "Брошено", bg_color: "bg-red-500" }, +}; +const YearSeason = ["_", "Зима", "Весна", "Лето", "Осень"]; + +export const ReleaseLink169Related = (props: any) => { + const grade = props.grade.toFixed(1); + const profile_list_status = props.profile_list_status; + let user_list = null; + if (profile_list_status != null || profile_list_status != 0) { + user_list = profile_lists[profile_list_status]; + } + return ( + +
+

+ {props.season ? YearSeason[props.season] : ""} +
+ {props.year ? props.year : ""} +

+
+
+
+
+ {props.title +
+
+
+ {props.genres && ( +

+ {props.genres} +

+ )} +

+ {`${props.title_ru.slice(0, 47)}${ + props.title_ru.length > 47 ? "..." : "" + }`} +

+

+ {`${props.description.slice(0, 97)}${ + props.description.length > 97 ? "..." : "" + }`} +

+

+ {props.title_ru} +

+

+ {props.description} +

+
+
+ + {user_list && ( + + )} + {props.status ? ( + + ) : ( + props.status_id != 0 && ( + + ) + )} + + {props.category && } + {props.season || props.year ? ( + + ) : ( + "" + )} + {props.is_favorite && ( +
+ +
+ )} +
+
+
+
+ + ); +}; diff --git a/app/components/ReleaseLink/ReleaseLink.Poster.tsx b/app/components/ReleaseLink/ReleaseLink.Poster.tsx new file mode 100644 index 0000000..438b7b6 --- /dev/null +++ b/app/components/ReleaseLink/ReleaseLink.Poster.tsx @@ -0,0 +1,84 @@ +import Link from "next/link"; +import { Chip } from "#/components/Chip/Chip"; + +const profile_lists = { + // 0: "Не смотрю", + 1: { name: "Смотрю", bg_color: "bg-green-500" }, + 2: { name: "В планах", bg_color: "bg-purple-500" }, + 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, + 4: { name: "Отложено", bg_color: "bg-yellow-500" }, + 5: { name: "Брошено", bg_color: "bg-red-500" }, +}; + +export const ReleaseLinkPoster = (props: any) => { + const grade = props.grade.toFixed(1); + const profile_list_status = props.profile_list_status; + let user_list = null; + if (profile_list_status != null || profile_list_status != 0) { + user_list = profile_lists[profile_list_status]; + } + return ( + +
+
+ + {props.status ? ( + + ) : ( + + )} + +
+
+ {props.title_ru && ( +

+ {props.title_ru} +

+ )} + {props.title_original && ( +

+ {props.title_original} +

+ )} +
+
+ + ); +}; diff --git a/app/components/ReleaseLink/ReleaseLink.tsx b/app/components/ReleaseLink/ReleaseLink.tsx new file mode 100644 index 0000000..f81e277 --- /dev/null +++ b/app/components/ReleaseLink/ReleaseLink.tsx @@ -0,0 +1,19 @@ +import { ReleaseLink169 } from "./ReleaseLink.16_9FullImage"; +import { ReleaseLink169Poster } from "./ReleaseLink.16_9Poster"; +import { ReleaseLinkPoster } from "./ReleaseLink.Poster"; + +export const ReleaseLink = (props: {type?: "16_9"|"poster"}) => { + const type = props.type || "16_9"; + + if (type == "16_9") { + return ( + <> +
+
+ + ) + } + if (type == "poster") { + return ; + } +}; diff --git a/app/components/ReleaseLink/ReleaseLinkUpdate.tsx b/app/components/ReleaseLink/ReleaseLinkUpdate.tsx deleted file mode 100644 index e448809..0000000 --- a/app/components/ReleaseLink/ReleaseLinkUpdate.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import Link from "next/link"; -import { PosterWithStuff } from "../ReleasePoster/PosterWithStuff"; - -export const ReleaseLink = (props: { - image: string; - title_ru: string; - title_original: string; - description?: string; - genres?: string; - grade?: number; - id: number; - settings?: { - showGenres?: boolean; - showDescription?: boolean; - }; - chipsSettings?: { - enabled: boolean; - gradeHidden?: boolean; - statusHidden?: boolean; - categoryHidden?: boolean; - episodesHidden?: boolean; - listHidden?: boolean; - favHidden?: boolean; - lastWatchedHidden?: boolean; - }; - profile_list_status?: number; - status?: { - name: string; - }; - category?: { - name: string; - }; - status_id?: number; - episodes_released?: string; - episodes_total?: string; - is_favorite?: boolean; -}) => { - return ( - - - - ); -}; diff --git a/app/components/ReleasePoster/Chips.tsx b/app/components/ReleasePoster/Chips.tsx deleted file mode 100644 index 8e1784b..0000000 --- a/app/components/ReleasePoster/Chips.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { sinceUnixDate } from "#/api/utils"; -import { Chip } from "../Chip/Chip"; - -interface ChipProps { - settings?: any; - grade?: any; - status?: any; - status_id?: any; - user_list?: any; - episodes_released?: any; - episodes_total?: any; - category?: any; - is_favorite?: any; - last_view_episode?: any; - last_view_timestamp?: any; -} - -export const ReleaseChips = ({ - settings, - grade, - status, - status_id, - user_list, - episodes_released, - episodes_total, - category, - is_favorite, - last_view_episode, - last_view_timestamp, -}: ChipProps) => { - const chipSettings = { - enabled: true, - gradeHidden: false, - statusHidden: false, - categoryHidden: false, - episodesHidden: false, - listHidden: false, - favHidden: false, - lastWatchedHidden: true, - ...settings, - }; - - return ( -
- {!chipSettings.gradeHidden && grade ? - - : ""} - {!chipSettings.listHidden && user_list && ( - - )} - {!chipSettings.statusHidden && status ? - - : status_id != 0 && ( - - ) - } - {!chipSettings.episodesHidden && ( - - )} - {!chipSettings.categoryHidden && category && } - {!chipSettings.favHidden && is_favorite && ( -
- -
- )} - {!chipSettings.lastWatchedHidden && last_view_episode && ( - - )} -
- ); -}; diff --git a/app/components/ReleasePoster/Poster.tsx b/app/components/ReleasePoster/Poster.tsx deleted file mode 100644 index 4d500cb..0000000 --- a/app/components/ReleasePoster/Poster.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import Image from "next/image"; - -export const Poster = (props: { - image: string; - alt?: string; - className?: string; -}) => { - return ( - {props.alt - ); -}; diff --git a/app/components/ReleasePoster/PosterWithStuff.tsx b/app/components/ReleasePoster/PosterWithStuff.tsx deleted file mode 100644 index adffc49..0000000 --- a/app/components/ReleasePoster/PosterWithStuff.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { Poster } from "./Poster"; -import { ReleaseChips } from "./Chips"; - -const profile_lists = { - // 0: "Не смотрю", - 1: { name: "Смотрю", bg_color: "bg-green-500" }, - 2: { name: "В планах", bg_color: "bg-purple-500" }, - 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, - 4: { name: "Отложено", bg_color: "bg-yellow-500" }, - 5: { name: "Брошено", bg_color: "bg-red-500" }, -}; - -export const PosterWithStuff = (props: { - image: string; - title_ru: string; - title_original: string; - description?: string; - genres?: string; - grade?: number; - id: number; - settings?: { - showGenres?: boolean; - showDescription?: boolean; - }; - chipsSettings?: { - enabled: boolean; - gradeHidden?: boolean; - statusHidden?: boolean; - categoryHidden?: boolean; - episodesHidden?: boolean; - listHidden?: boolean; - favHidden?: boolean; - lastWatchedHidden?: boolean; - }; - profile_list_status?: number; - status?: { - name: string; - }; - category?: { - name: string; - }; - status_id?: number; - episodes_released?: string; - episodes_total?: string; - is_favorite?: boolean; -}) => { - const genres = []; - const settings = { - showGenres: true, - showDescription: true, - ...props.settings, - }; - const chipsSettings = props.chipsSettings || {} - - const grade = props.grade ? Number(props.grade.toFixed(1)) : null; - const profile_list_status = props.profile_list_status || null; - let user_list = null; - if (profile_list_status != null || profile_list_status != 0) { - user_list = profile_lists[profile_list_status]; - } - if (props.genres) { - const genres_array = props.genres.split(","); - genres_array.forEach((genre) => { - genres.push(genre.trim()); - }); - } - - return ( -
-
- -
-
-
- {settings.showGenres && - genres.length > 0 && - genres.map((genre: string, index: number) => { - return ( - - {index > 0 && ", "} - {genre} - - ); - })} - {props.title_ru && ( -

- {props.title_ru} -

- )} - {props.title_original && ( -

- {props.title_original} -

- )} -
- {settings.showDescription && props.description && ( -

- {props.description} -

- )} -
-
- -
- ); -}; diff --git a/app/components/ReleaseSection/ReleaseSection.tsx b/app/components/ReleaseSection/ReleaseSection.tsx index b826085..734e388 100644 --- a/app/components/ReleaseSection/ReleaseSection.tsx +++ b/app/components/ReleaseSection/ReleaseSection.tsx @@ -1,4 +1,4 @@ -import { ReleaseLink } from "../ReleaseLink/ReleaseLinkUpdate"; +import { ReleaseLink } from "../ReleaseLink/ReleaseLink"; export const ReleaseSection = (props: { sectionTitle?: string; @@ -14,22 +14,15 @@ export const ReleaseSection = (props: {
)}
-
+
{props.content.map((release) => { return ( -
- +
+
); })} + {props.content.length == 1 &&
}
diff --git a/app/pages/CreateCollection.tsx b/app/pages/CreateCollection.tsx index cd0c3b7..e943634 100644 --- a/app/pages/CreateCollection.tsx +++ b/app/pages/CreateCollection.tsx @@ -15,7 +15,7 @@ import { Modal, useThemeMode, } from "flowbite-react"; -import { PosterWithStuff } from "#/components/ReleasePoster/PosterWithStuff"; +import { ReleaseLink } from "#/components/ReleaseLink/ReleaseLink"; import { CropModal } from "#/components/CropModal/CropModal"; import { b64toBlob, tryCatchAPI } from "#/api/utils"; @@ -462,17 +462,20 @@ export const CreateCollectionPage = () => {
-
+
{addedReleases.map((release) => { return ( -
+
- +
); })} @@ -589,9 +592,6 @@ export const ReleasesEditModal = (props: { return; } - const newContent = content.filter((r) => r.id !== release.id); - - setContent(newContent); props.setReleases([...props.releases, release]); props.setReleasesIds([...props.releasesIds, release.id]); } @@ -611,7 +611,11 @@ export const ReleasesEditModal = (props: { >
e.preventDefault()} + onSubmit={(e) => { + e.preventDefault(); + setContent([]); + setQuery(e.target[0].value.trim()); + }} >
-
+
{content.map((release) => { return ( ); })} + {content.length == 1 &&
}
{isLoading && (
diff --git a/app/pages/Related.tsx b/app/pages/Related.tsx index 9865c8a..beb5d05 100644 --- a/app/pages/Related.tsx +++ b/app/pages/Related.tsx @@ -5,24 +5,11 @@ import { useState, useEffect } from "react"; import { useScrollPosition } from "#/hooks/useScrollPosition"; import { useUserStore } from "../store/auth"; import { ENDPOINTS } from "#/api/config"; +import { ReleaseLink169Related } from "#/components/ReleaseLink/ReleaseLink.16_9Related"; import { useSWRfetcher } from "#/api/utils"; -import { Card } from "flowbite-react"; -import { Poster } from "#/components/ReleasePoster/Poster"; -import { ReleaseChips } from "#/components/ReleasePoster/Chips"; -import { PosterWithStuff } from "#/components/ReleasePoster/PosterWithStuff"; -import Link from "next/link"; -const profile_lists = { - // 0: "Не смотрю", - 1: { name: "Смотрю", bg_color: "bg-green-500" }, - 2: { name: "В планах", bg_color: "bg-purple-500" }, - 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, - 4: { name: "Отложено", bg_color: "bg-yellow-500" }, - 5: { name: "Брошено", bg_color: "bg-red-500" }, -}; -const YearSeason = ["_", "Зима", "Весна", "Лето", "Осень"]; -export function RelatedPage(props: { id: number | string; title: string }) { +export function RelatedPage(props: {id: number|string, title: string}) { const token = useUserStore((state) => state.token); const getKey = (pageIndex: number, previousPageData: any) => { @@ -65,95 +52,22 @@ export function RelatedPage(props: { id: number | string; title: string }) { Франшиза {props.title}
- {content && content.length > 0 ? + {content && content.length > 0 ? (
{content.map((release, index) => { - const genres = []; - const grade = - release.grade ? Number(release.grade.toFixed(1)) : null; - const profile_list_status = release.profile_list_status || null; - let user_list = null; - if (profile_list_status != null || profile_list_status != 0) { - user_list = profile_lists[profile_list_status]; - } - if (release.genres) { - const genres_array = release.genres.split(","); - genres_array.forEach((genre) => { - genres.push(genre.trim()); - }); - } - return ( - - -
-
-

- {release.season ? YearSeason[release.season] : ""} - {release.season ? -
- : ""} - {release.year ? release.year : ""} -

-
-
-
- -
-
-
- -
-
- -
- {genres.length > 0 && - genres.map((genre: string, index: number) => { - return ( - - {index > 0 && ", "} - {genre} - - ); - })} -
- {release.title_ru && ( -

- {release.title_ru} -

- )} - {release.title_original && ( -

- {release.title_original} -

- )} - {release.description && ( -

- {release.description} -

- )} -
-
-
- - ); + return })}
- : isLoading ? + ) : isLoading ? (
- :
+ ) : ( +

В франшизе пока ничего нет...

- } + )} {data && data[data.length - 1].current_page < data[data.length - 1].total_page_count && (