PluginProbe
BeyondWords – AI audio for publishers / 7.0.0
BeyondWords – AI audio for publishers v7.0.0
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / editor / components / open-sidebar / index.js

index.js in BeyondWords – AI audio for publishers 7.0.0, at src/editor/components/open-sidebar/index.js

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { __ } from '@wordpress/i18n';
5 import { compose } from '@wordpress/compose';
6 import { withSelect, withDispatch } from '@wordpress/data';
7 import { Fragment } from '@wordpress/element';
8
9 export function OpenSidebar( { openSidebar, wrapper = Fragment } ) {
10 const Wrapper = wrapper;
11
12 return (
13 <Wrapper>
14 <p style={ { marginBottom: 0, paddingBottom: 0 } }>
15 { __( 'Open the', 'speechkit' ) }{ ' ' }
16 <a
17 href="#beyondwords-plugin-sidebar"
18 onClick={ () => {
19 openSidebar();
20 } }
21 >
22 { __( 'BeyondWords sidebar', 'speechkit' ) }
23 </a>{ ' ' }
24 { __( 'for additional options and features.', 'speechkit' ) }
25 </p>
26 </Wrapper>
27 );
28 }
29
30 export default compose( [
31 withSelect( ( select ) => {
32 const { getEditedPostAttribute } = select( 'core/editor' );
33
34 return {
35 src: getEditedPostAttribute( 'meta' )._speechkit_link,
36 };
37 } ),
38 withDispatch( ( dispatch ) => {
39 const { openGeneralSidebar } = dispatch( 'core/edit-post' );
40 return {
41 openSidebar: () => {
42 openGeneralSidebar(
43 'beyondwords-plugin-sidebar/plugin-sidebar'
44 );
45 },
46 };
47 } ),
48 ] )( OpenSidebar );
49