Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks: Polish and update timeline block to support alternating on large screens #41474

Merged
merged 15 commits into from
Jul 9, 2020
Merged
Prev Previous commit
Next Next commit
Move Alternating control to sidebar
  • Loading branch information
George Hotelling committed Jul 2, 2020
commit 5a7ad97e15995157d9d0d8f0cdf4b2e923817c09
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* External dependencies
*/

import { InnerBlocks, BlockControls } from '@wordpress/block-editor';
import { InnerBlocks, InspectorControls } from '@wordpress/block-editor';
import { registerBlockType, createBlock } from '@wordpress/blocks';
import { ToolbarButton } from '@wordpress/components';
import { ToggleControl } from '@wordpress/components';
import { dispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
Expand Down Expand Up @@ -97,9 +97,13 @@ export function registerTimelineBlock() {

return (
<>
<BlockControls>
<ToolbarButton onClick={ toggleAlternate }>Toggle Alternating</ToolbarButton>
</BlockControls>
<InspectorControls>
<ToggleControl
label={ __( 'Alternate Items', 'full-site-editing' ) }
onChange={ toggleAlternate }
checked={ isAlternating }
/>
</InspectorControls>
<ul className={ classes }>
<InnerBlocks
allowedBlocks={ [ 'jetpack/timeline-item' ] }
Expand Down