create-block-button.js in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites 3.1.4, at admin/pages/demo/create-block-button.js
| 1 | import { |
| 2 | Button, |
| 3 | Tooltip, |
| 4 | Dashicon |
| 5 | } from '@wordpress/components'; |
| 6 | |
| 7 | const { __ } = wp.i18n; |
| 8 | |
| 9 | const CreateBlockButton = ({ href }) => { |
| 10 | |
| 11 | return ( |
| 12 | <Tooltip |
| 13 | text={__('Create Page with Template', 'blockspare')} |
| 14 | > |
| 15 | <Button |
| 16 | isSmall |
| 17 | className="bs-layout-action-button bs-layout-create-block-button" |
| 18 | href={href} |
| 19 | target='_blank' |
| 20 | > |
| 21 | <Dashicon |
| 22 | icon={'plus-alt2'} |
| 23 | className='bs-layout-action-button-icon' |
| 24 | /> |
| 25 | </Button> |
| 26 | </Tooltip> |
| 27 | ) |
| 28 | } |
| 29 | |
| 30 | export default CreateBlockButton |
| 31 |