diff --git a/src/components/reviews/review-form.tsx b/src/components/reviews/review-form.tsx index c9d0916..143535a 100644 --- a/src/components/reviews/review-form.tsx +++ b/src/components/reviews/review-form.tsx @@ -1,6 +1,10 @@ import { useState } from 'react'; import { store, useAppSelector } from '../../store/store.ts'; import { postReview } from '../../store/actions.ts'; +import { + MAX_COMMENT_LENGTH, + MIN_COMMENT_LENGTH, +} from '../../consts/reviews.ts'; type UserReview = { comment?: string; @@ -29,7 +33,10 @@ export function ReviewForm(): React.JSX.Element { ); }; const isValid = - review?.comment && review?.comment?.length >= 50 && review?.rating; + review?.comment && + review?.comment?.length >= MIN_COMMENT_LENGTH && + review?.comment?.length <= MAX_COMMENT_LENGTH && + review?.rating; return (