PluginProbe
WP Discourse / trunk
WP Discourse vtrunk
2.6.4 2.6.3 1.2.1 1.2.2 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.85 1.4.0 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 All 150 releases
wp-discourse / blocks / comments / src / edit / index.js

index.js in WP Discourse trunk, at blocks/comments/src/edit/index.js

30 lines 752 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { useBlockProps, useSettings } from '@wordpress/block-editor';
5
6 /**
7 * Internal dependencies
8 */
9 import WPDiscourseCommentsPlaceholder from './placeholder';
10
11 export default function WPDiscourseCommentsEdit( props ) {
12 const blockProps = useBlockProps();
13 const defaultLayout = useSettings( 'layout' ) || {};
14
15 // TODO: Workaround for permissions issue described here https://github.com/WordPress/gutenberg/issues/20731
16 const urlMeta = document.head.querySelector( '[name~=wpdc-url][content]' );
17 if ( urlMeta ) {
18 props.discourse_url = urlMeta.content;
19 }
20
21 return (
22 <div { ...blockProps }>
23 <WPDiscourseCommentsPlaceholder
24 __experimentalLayout={ defaultLayout }
25 { ...props }
26 />
27 </div>
28 );
29 }
30