Skip to content

Commit

Permalink
[Bugfix/FE] 리뷰 작성 최대 길이 검증 수정 (#382)
Browse files Browse the repository at this point in the history
fix: 리뷰 작성 최대 길이 검증 수정
  • Loading branch information
uk960214 authored Aug 4, 2022
1 parent af64ec7 commit ecf13f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/components/common/ReviewForm/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function ReviewForm({

const handleContentChange: React.ChangeEventHandler<HTMLTextAreaElement> =
useCallback(({ target: { value } }) => {
if (value.length > 1000) return;

setContent(value);
}, []);

Expand Down Expand Up @@ -78,7 +80,12 @@ function ReviewForm({
<p>총평을 입력해주세요</p>
<p>{content.length} / 1000</p>
</S.LabelTop>
<S.Textarea value={content} onChange={handleContentChange} required />
<S.Textarea
value={content}
onChange={handleContentChange}
required
maxLength={1000}
/>
</S.Label>
<S.Footer>
<S.SubmitButton>{isEdit ? '리뷰 수정' : '리뷰 추가'}</S.SubmitButton>
Expand Down

0 comments on commit ecf13f3

Please sign in to comment.