/** * WordPress dependencies. */ const { blockEditor: { InspectorControls, }, components: { Disabled, PanelBody, RangeControl, SelectControl, TextControl, }, element: { Fragment, createElement, }, i18n: { __, }, serverSideRender: ServerSideRender, } = wp; /** * BuddyPress dependencies. */ const { blockData: { currentPostId, activityTypes, } } = bp; const editDynamicActivitiesBlock = ( { attributes, setAttributes } ) => { const { postId, maxActivities, type, title } = attributes; const post = currentPostId(); const types = activityTypes(); if ( ! postId && post ) { setAttributes( { postId: post } ); if ( ! attributes.postId ) { attributes.postId = post; } } return ( { setAttributes( { title: text } ); } } /> setAttributes( { maxActivities: value } ) } min={ 1 } max={ 10 } required /> { setAttributes( { type: option } ); } } /> ); }; export default editDynamicActivitiesBlock;