block.js
38 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | const { __ } = wp.i18n; |
| 5 | |
| 6 | /** |
| 7 | * WordPress dependencies |
| 8 | */ |
| 9 | const { Fragment } = wp.element; |
| 10 | const { ServerSideRender } = wp.components; |
| 11 | const { withSelect } = wp.data; |
| 12 | |
| 13 | /** |
| 14 | * Internal dependencies |
| 15 | */ |
| 16 | import Inspector from './inspector'; |
| 17 | |
| 18 | /** |
| 19 | * Render Block UI For Editor |
| 20 | */ |
| 21 | |
| 22 | const GiveDonationFormGrid = ( props ) => { |
| 23 | const {attributes} = props; |
| 24 | |
| 25 | return ( |
| 26 | <Fragment> |
| 27 | <Inspector { ... { ...props } } /> |
| 28 | <ServerSideRender block="give/donation-form-grid" attributes={ attributes } /> |
| 29 | </Fragment> |
| 30 | ); |
| 31 | }; |
| 32 | |
| 33 | export default withSelect( ( select ) => { |
| 34 | return { |
| 35 | forms: select( 'core' ).getEntityRecords( 'postType', 'give_forms' ), |
| 36 | }; |
| 37 | } )( GiveDonationFormGrid ); |
| 38 |