diff --git a/TODO.md b/TODO.md
index b8dc2ae..d379a06 100644
--- a/TODO.md
+++ b/TODO.md
@@ -66,9 +66,9 @@
- [X] Добавление \ Удаление аниме в\из списков закладок и избранных
- [X] Связанные релизы
- [X] Просмотр страницы всех связанных релизов
-- [ ] Оценка тайтла
+- [X] Оценка тайтла
- [X] Просмотр оценки
- - [ ] Оценивание и изменение своей оценки (как Modal)
+ - [X] Оценивание и изменение своей оценки (как Modal)
## Стиль
diff --git a/app/components/ReleaseInfo/ReleaseInfo.Rating.tsx b/app/components/ReleaseInfo/ReleaseInfo.Rating.tsx
index dbe1be0..6f78499 100644
--- a/app/components/ReleaseInfo/ReleaseInfo.Rating.tsx
+++ b/app/components/ReleaseInfo/ReleaseInfo.Rating.tsx
@@ -4,8 +4,11 @@ import {
Flowbite,
Button,
CustomFlowbiteTheme,
+ Modal,
} from "flowbite-react";
import { numberDeclension } from "#/api/utils";
+import { useState } from "react";
+import { ENDPOINTS } from "#/api/config";
const RatingTheme: CustomFlowbiteTheme = {
ratingAdvanced: {
@@ -15,6 +18,7 @@ const RatingTheme: CustomFlowbiteTheme = {
},
};
export const ReleaseInfoRating = (props: {
+ release_id: number;
grade: number;
token: string | null;
votes: {
@@ -27,88 +31,217 @@ export const ReleaseInfoRating = (props: {
user: number | null;
};
}) => {
+ const [isRatingModalOpen, setIsRatingModalOpen] = useState(false);
+ const [vote, setVote] = useState(props.votes.user);
+
return (
-
- {props.grade.toFixed(2)} из 5
-
+ {props.grade.toFixed(2)} из 5
+
- ваша оценка: {props.votes.user}
-
+ ваша оценка: {vote}
+
+ {props.votes.total}{" "}
+ {numberDeclension(props.votes.total, "голос", "голоса", "голосов")}
+
- {props.votes.total}{" "}
- {numberDeclension(props.votes.total, "голос", "голоса", "голосов")}
-