diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index a52421fd..d690a0a0 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -233,5 +233,7 @@ "By time": "By time", "New only": "New only", "Bookmarks": "Bookmarks", - "Logout": "Logout" + "Logout": "Logout", + "This comment has not yet been rated": "This comment has not yet been rated", + "This post has not been rated yet": "This post has not been rated yet" } diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 187b38d4..cb056a2b 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -251,5 +251,7 @@ "By time": "По порядку", "New only": "Только новые", "Bookmarks": "Закладки", - "Logout": "Выход" + "Logout": "Выход", + "This comment has not yet been rated": "Этот комментарий еще пока никто не оценил", + "This post has not been rated yet": "Эту публикацию еще пока никто не оценил" } diff --git a/src/components/Article/CommentRatingControl.tsx b/src/components/Article/CommentRatingControl.tsx index 69598129..181d5ea2 100644 --- a/src/components/Article/CommentRatingControl.tsx +++ b/src/components/Article/CommentRatingControl.tsx @@ -4,11 +4,12 @@ import type { Reaction } from '../../graphql/types.gen' import { ReactionKind } from '../../graphql/types.gen' import { useSession } from '../../context/session' import { useReactions } from '../../context/reactions' -import { createMemo, For } from 'solid-js' +import { createMemo } from 'solid-js' import { loadShout } from '../../stores/zine/articles' import { Popup } from '../_shared/Popup' import { useLocalize } from '../../context/localize' import { useSnackbar } from '../../context/snackbar' +import VotersList from '../_shared/VotersList' type Props = { comment: Reaction @@ -37,7 +38,7 @@ export const CommentRatingControl = (props: Props) => { const isDownvoted = createMemo(() => checkReaction(ReactionKind.Dislike)) const canVote = createMemo(() => userSlug() !== props.comment.createdBy.slug) - const shoutRatingReactions = createMemo(() => + const commentRatingReactions = createMemo(() => Object.values(reactionEntities).filter( (r) => [ReactionKind.Like, ReactionKind.Dislike].includes(r.kind) && @@ -45,6 +46,7 @@ export const CommentRatingControl = (props: Props) => { r.replyTo === props.comment.id ) ) + const deleteCommentReaction = async (reactionKind: ReactionKind) => { const reactionToDelete = Object.values(reactionEntities).find( (r) => @@ -102,15 +104,10 @@ export const CommentRatingControl = (props: Props) => { } variant="tiny" > - + {props.shout.stat.rating}} variant="tiny"> - +