index.js
38 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | import {__} from '@wordpress/i18n'; |
| 5 | import {registerBlockType} from '@wordpress/blocks'; |
| 6 | |
| 7 | /** |
| 8 | * Internal dependencies |
| 9 | */ |
| 10 | import GiveIcon from '@givewp/components/GiveIcon'; |
| 11 | import blockAttributes from './data/attributes'; |
| 12 | import Edit from '../../src/DonationForms/Blocks/DonationFormBlock/resources/editor/Edit'; |
| 13 | |
| 14 | /** |
| 15 | * Register Block |
| 16 | */ |
| 17 | |
| 18 | export default registerBlockType('give/donation-form', { |
| 19 | title: __('Donation Form', 'give'), |
| 20 | description: __( |
| 21 | "The GiveWP Donation Form block inserts an existing donation form into the page. Each donation form's presentation can be customized below.", |
| 22 | 'give' |
| 23 | ), |
| 24 | category: 'give', |
| 25 | icon: <GiveIcon color="grey" />, |
| 26 | keywords: [__('donation', 'give')], |
| 27 | supports: { |
| 28 | html: false, |
| 29 | }, |
| 30 | attributes: blockAttributes, |
| 31 | edit: Edit, |
| 32 | |
| 33 | save: () => { |
| 34 | // Server side rendering via shortcode |
| 35 | return null; |
| 36 | }, |
| 37 | }); |
| 38 |