rating-reactivity-fixing-2

This commit is contained in:
Untone 2024-02-16 11:02:00 +03:00
parent dab1eff314
commit dfb2b17116

View File

@ -132,10 +132,11 @@ export const RatingControl = (props: RatingControlProps) => {
onClick={() => handleRatingChange(ReactionKind.Dislike)} onClick={() => handleRatingChange(ReactionKind.Dislike)}
disabled={isLoading()} disabled={isLoading()}
class={ class={
props.comment ? clsx(stylesComment.commentRatingControl, props.comment
stylesComment.commentRatingControlUp, ? clsx(stylesComment.commentRatingControl, stylesComment.commentRatingControlUp, {
{ [stylesComment.voted]: myRate()?.kind === 'LIKE'} [stylesComment.voted]: myRate()?.kind === 'LIKE',
) : '' })
: ''
} }
> >
<Show when={!props.comment}> <Show when={!props.comment}>
@ -157,10 +158,11 @@ export const RatingControl = (props: RatingControlProps) => {
onClick={() => handleRatingChange(ReactionKind.Like)} onClick={() => handleRatingChange(ReactionKind.Like)}
disabled={isLoading()} disabled={isLoading()}
class={ class={
props.comment ? clsx(stylesComment.commentRatingControl, props.comment
stylesComment.commentRatingControlDown, ? clsx(stylesComment.commentRatingControl, stylesComment.commentRatingControlDown, {
{ [stylesComment.voted]: myRate()?.kind === 'DISLIKE'} [stylesComment.voted]: myRate()?.kind === 'DISLIKE',
) : '' })
: ''
} }
> >
<Show when={!props.comment}> <Show when={!props.comment}>