AuthorMetaControl.js
3 years ago
CommentsControl.js
4 years ago
ContentTypeControl.js
4 years ago
DynamicSourceControl.js
3 years ago
ExcerptControl.js
4 years ago
LinkTypeControl.js
3 years ago
PostDateControl.js
4 years ago
PostMetaControl.js
3 years ago
TermsControl.js
4 years ago
CommentsControl.js
39 lines
| 1 | import { TextControl } from '@wordpress/components'; |
| 2 | import { __ } from '@wordpress/i18n'; |
| 3 | |
| 4 | export default function CommentsControl( props ) { |
| 5 | const { |
| 6 | isActive, |
| 7 | noCommentsText, |
| 8 | singleCommentText, |
| 9 | multipleCommentsText, |
| 10 | setAttributes, |
| 11 | } = props; |
| 12 | |
| 13 | return ( |
| 14 | <> |
| 15 | { isActive && |
| 16 | <> |
| 17 | <TextControl |
| 18 | label={ __( 'No comments text', 'generateblocks' ) } |
| 19 | value={ noCommentsText } |
| 20 | onChange={ ( value ) => setAttributes( { noCommentsText: value } ) } |
| 21 | /> |
| 22 | |
| 23 | <TextControl |
| 24 | label={ __( 'Single comment text', 'generateblocks' ) } |
| 25 | value={ singleCommentText } |
| 26 | onChange={ ( value ) => setAttributes( { singleCommentText: value } ) } |
| 27 | /> |
| 28 | |
| 29 | <TextControl |
| 30 | label={ __( 'Multiple comments text', 'generateblocks' ) } |
| 31 | value={ multipleCommentsText } |
| 32 | onChange={ ( value ) => setAttributes( { multipleCommentsText: value } ) } |
| 33 | /> |
| 34 | </> |
| 35 | } |
| 36 | </> |
| 37 | ); |
| 38 | } |
| 39 |