@@ -14,14 +14,15 @@ import upvoteComment from '@/api/comment/upvote';
14
14
import { unUpvoteComment } from '@/api/comment/unUpvote' ;
15
15
import { useAPI } from '@/api/api' ;
16
16
17
- function CommentEditorFooter ( comment : Comment , onUpdate : ( text : string , anonymous : boolean ) => void , t : TFunction ) {
17
+ function CommentEditorFooter ( comment : Comment , onUpdate : ( text : string , anonymous : boolean ) => void ) {
18
18
return function CommentEditorFooter ( { text, disable } : { text : string ; disable : ( ) => void } ) {
19
19
const [ anonymous , setAnonymous ] = useState < boolean > ( comment . isAnonymous ) ;
20
20
const { t } = useAppTranslation ( ) ;
21
21
return (
22
22
< div className = { styles . commentEditorFooter } >
23
23
< div >
24
- { t ( 'ues:detailed.comments.write.anonymous' ) } : < input type = { 'checkbox' } checked = { anonymous } onChange = { ( ) => setAnonymous ( ! anonymous ) } />
24
+ { t ( 'ues:detailed.comments.write.anonymous' ) } :{ ' ' }
25
+ < input type = { 'checkbox' } checked = { anonymous } onChange = { ( ) => setAnonymous ( ! anonymous ) } />
25
26
</ div >
26
27
< Button
27
28
className = { styles . button }
@@ -116,15 +117,11 @@ export default function Comments({ code }: { code: string }) {
116
117
textClassName = { styles . text }
117
118
text = { comment . body }
118
119
enabled = { comment . author ?. id === user . id }
119
- EditingFooter = { CommentEditorFooter (
120
- comment ,
121
- async ( text , anonymous ) => {
122
- const updatedComment = await editComment ( api , comment . id , text , anonymous ) . toPromise ( ) ;
123
- if ( ! updatedComment ) return ;
124
- setComment ( i , updatedComment ) ;
125
- } ,
126
- t ,
127
- ) }
120
+ EditingFooter = { CommentEditorFooter ( comment , async ( text , anonymous ) => {
121
+ const updatedComment = await editComment ( api , comment . id , text , anonymous ) . toPromise ( ) ;
122
+ if ( ! updatedComment ) return ;
123
+ setComment ( i , updatedComment ) ;
124
+ } ) }
128
125
NormalViewFooter = { CommentFooter ( code , comment , comment . author ?. id === user . id , t , ( updatedComment ) =>
129
126
setComment ( i , updatedComment ) ,
130
127
) }
0 commit comments