# speechkit/4.2.4/src/Component/Post/OpenSidebar/index.js

BeyondWords – AI audio for publishers, version 4.2.4. 49 lines.

- Page: https://pluginprobe.com/plugins/speechkit/4.2.4/code/src/Component/Post/OpenSidebar/index.js
- Raw: https://pluginprobe.com/plugins/speechkit/4.2.4/raw/src/Component/Post/OpenSidebar/index.js
- Modified: 2023-11-15T21:11:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/speechkit/4.2.4/code/src/Component/Post/OpenSidebar/index.js#L10-L20`.

```javascript
/**
 * WordPress dependencies
 */
import { __ } from '@wordpress/i18n';
import { compose } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';
import { Fragment } from '@wordpress/element';

export function OpenSidebar( { openSidebar, wrapper = Fragment } ) {
	const Wrapper = wrapper;

	return (
		<Wrapper>
			<p style={ { marginBottom: 0, paddingBottom: 0 } }>
				{ __( 'Open the', 'speechkit' ) }{ ' ' }
				<a
					href="#beyondwords-plugin-sidebar"
					onClick={ () => {
						openSidebar();
					} }
				>
					{ __( 'BeyondWords sidebar', 'speechkit' ) }
				</a>{ ' ' }
				{ __( 'for additional options and features.', 'speechkit' ) }
			</p>
		</Wrapper>
	);
}

export default compose( [
	withSelect( ( select ) => {
		const { getEditedPostAttribute } = select( 'core/editor' );

		return {
			src: getEditedPostAttribute( 'meta' )._speechkit_link,
		};
	} ),
	withDispatch( ( dispatch ) => {
		const { openGeneralSidebar } = dispatch( 'core/edit-post' );
		return {
			openSidebar: () => {
				openGeneralSidebar(
					'beyondwords-plugin-sidebar/plugin-sidebar'
				);
			},
		};
	} ),
] )( OpenSidebar );

```
