withQueryLoop.js
16 lines
| 1 | import QueryLoopRenderer from '../components/QueryLoopRenderer'; |
| 2 | |
| 3 | export default ( WrappedComponent ) => { |
| 4 | return ( props ) => { |
| 5 | const { attributes } = props; |
| 6 | |
| 7 | const newProps = attributes.isQueryLoop ? Object.assign( {}, props, { |
| 8 | defaultLayout: '100', |
| 9 | templateLock: 'all', |
| 10 | InnerBlocksRenderer: QueryLoopRenderer, |
| 11 | } ) : props; |
| 12 | |
| 13 | return <WrappedComponent { ...newProps } />; |
| 14 | }; |
| 15 | }; |
| 16 |