File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { sendComment } from 'apis/comment'
4
4
import clsx from 'clsx'
5
5
import { useContext , useState } from 'react'
6
6
7
+ import { MAX_COMMENT_LENGTH } from '../../../models/comment'
7
8
import { formatError } from '../../../utils/error'
8
9
import { wrapErrorMessage } from '../../../utils/wrapErrorMessage'
9
10
import { Markdown } from '../../Markdown'
@@ -23,7 +24,7 @@ export const CommentForm = ({
23
24
primary,
24
25
placeholder = '发一条友善的评论吧' ,
25
26
inputAutoFocus,
26
- maxLength,
27
+ maxLength = MAX_COMMENT_LENGTH ,
27
28
} : CommentFormProps ) => {
28
29
const { operationId, replyTo, reload } = useContext ( CommentAreaContext )
29
30
@@ -83,7 +84,7 @@ export const CommentForm = ({
83
84
rows = { 2 }
84
85
growVertically
85
86
large
86
- maxLength = { maxLength ?? 150 }
87
+ maxLength = { maxLength }
87
88
placeholder = { placeholder }
88
89
value = { message }
89
90
onChange = { ( e ) => setMessage ( e . target . value ) }
@@ -112,7 +113,7 @@ export const CommentForm = ({
112
113
</ Checkbox >
113
114
114
115
< div className = "ml-auto text-slate-500 text-sm" >
115
- { message . length } /{ maxLength ?? 150 }
116
+ { message . length } /{ maxLength }
116
117
</ div >
117
118
</ div >
118
119
You can’t perform that action at this time.
0 commit comments