| 1 |
/** |
| 2 |
* WordPress dependencies |
| 3 |
*/ |
| 4 |
import { PanelRow } from '@wordpress/components'; |
| 5 |
import { PluginPrePublishPanel } from '@wordpress/editor'; |
| 6 |
import { Component } from '@wordpress/element'; |
| 7 |
|
| 8 |
/** |
| 9 |
* Internal dependencies |
| 10 |
*/ |
| 11 |
import { BeyondwordsTitle } from '../../components/icon'; |
| 12 |
import ErrorNotice from '../../components/error-notice'; |
| 13 |
import GenerateAudio from '../../components/generate-audio'; |
| 14 |
import Stack from '../../components/stack'; |
| 15 |
|
| 16 |
// Suppress the default plugin icon rendered after the title (a generic "plug") — |
| 17 |
// the brand icon already sits before the label via <BeyondwordsTitle />. |
| 18 |
const NoIcon = () => null; |
| 19 |
|
| 20 |
export default class PrepublishPanel extends Component { |
| 21 |
// Only the "Generate audio" control; Voice and Player settings live in the plugin sidebar. |
| 22 |
render() { |
| 23 |
return ( |
| 24 |
<PluginPrePublishPanel |
| 25 |
name="beyondwords-prepublish-panel" |
| 26 |
title={ <BeyondwordsTitle /> } |
| 27 |
icon={ NoIcon } |
| 28 |
initialOpen={ true } |
| 29 |
className="beyondwords-sidebar" |
| 30 |
> |
| 31 |
<Stack> |
| 32 |
<ErrorNotice wrapper={ PanelRow } /> |
| 33 |
<GenerateAudio wrapper={ PanelRow } /> |
| 34 |
</Stack> |
| 35 |
</PluginPrePublishPanel> |
| 36 |
); |
| 37 |
} |
| 38 |
} |
| 39 |
|