Skip to content

Commit

Permalink
feat(carousel): move panels around and rename them
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillot committed Feb 7, 2025
1 parent 65a1b0d commit 4d9cc5c
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions src/blocks/carousel/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,37 @@ class Edit extends Component {
</div>

<InspectorControls>
<PanelBody title={ __( 'Settings', 'newspack-blocks' ) }>
<PanelBody title={ __( 'Content', 'newspack-blocks' ) }>
{ postsToShow && (
<QueryControls
numberOfItems={ postsToShow }
onNumberOfItemsChange={ value =>
setAttributes( { postsToShow: value ? value : 1 } )
}
authors={ authors }
onAuthorsChange={ value => setAttributes( { authors: value } ) }
categories={ categories }
onCategoriesChange={ value => setAttributes( { categories: value } ) }
includeSubcategories={ includeSubcategories }
onIncludeSubcategoriesChange={ value =>
setAttributes( { includeSubcategories: value } )
}
tags={ tags }
onTagsChange={ value => setAttributes( { tags: value } ) }
onCustomTaxonomiesChange={ value => setAttributes( { customTaxonomies: value } ) }
customTaxonomies={ customTaxonomies }
specificMode={ specificMode }
onSpecificModeChange={ () => setAttributes( { specificMode: true } ) }
onLoopModeChange={ () => setAttributes( { specificMode: false } ) }
specificPosts={ specificPosts }
onSpecificPostsChange={ _specificPosts =>
setAttributes( { specificPosts: _specificPosts } )
}
postType={ postType }
/>
) }
</PanelBody>
<PanelBody title={ __( 'Display', 'newspack-blocks' ) }>
<ToggleControl
label={ __( 'Hide Controls', 'newspack-blocks' ) }
help={ __( 'Remove navigation indicators from view.', 'newspack-blocks' ) }
Expand Down Expand Up @@ -409,37 +439,7 @@ class Edit extends Component {
/>
) }
</PanelBody>
<PanelBody title={ __( 'Loop', 'newspack-blocks' ) } initialOpen={ false }>
{ postsToShow && (
<QueryControls
numberOfItems={ postsToShow }
onNumberOfItemsChange={ value =>
setAttributes( { postsToShow: value ? value : 1 } )
}
authors={ authors }
onAuthorsChange={ value => setAttributes( { authors: value } ) }
categories={ categories }
onCategoriesChange={ value => setAttributes( { categories: value } ) }
includeSubcategories={ includeSubcategories }
onIncludeSubcategoriesChange={ value =>
setAttributes( { includeSubcategories: value } )
}
tags={ tags }
onTagsChange={ value => setAttributes( { tags: value } ) }
onCustomTaxonomiesChange={ value => setAttributes( { customTaxonomies: value } ) }
customTaxonomies={ customTaxonomies }
specificMode={ specificMode }
onSpecificModeChange={ () => setAttributes( { specificMode: true } ) }
onLoopModeChange={ () => setAttributes( { specificMode: false } ) }
specificPosts={ specificPosts }
onSpecificPostsChange={ _specificPosts =>
setAttributes( { specificPosts: _specificPosts } )
}
postType={ postType }
/>
) }
</PanelBody>
<PanelBody title={ __( 'Featured Image', 'newspack-blocks' ) } initialOpen={ false } className="newspack-block__panel">
<PanelBody title={ __( 'Featured Image', 'newspack-blocks' ) } className="newspack-block__panel">
<BaseControl
label={ __( 'Aspect ratio', 'newspack-blocks' ) }
help={ __(
Expand Down Expand Up @@ -511,7 +511,7 @@ class Edit extends Component {
onChange={ () => setAttributes( { showCredit: ! showCredit } ) }
/>
</PanelBody>
<PanelBody title={ __( 'Post Meta', 'newspack-blocks' ) } initialOpen={ false }>
<PanelBody title={ __( 'Post Meta', 'newspack-blocks' ) }>
<ToggleControl
label={ __( 'Show title', 'newspack-blocks' ) }
checked={ showTitle }
Expand Down

0 comments on commit 4d9cc5c

Please sign in to comment.