Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Blocks/tabs-item/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "yard/tabs-item",
"version": "0.1.1",
"version": "0.2.0",
"title": "Tabblad",
"category": "yard",
"description": "Tabblad item.",
Expand Down
2 changes: 1 addition & 1 deletion build/Blocks/tabs-item/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices'), 'version' => 'c31690ab94c9638acdb3');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices'), 'version' => '015973d194c36a3f3979');
2 changes: 1 addition & 1 deletion build/Blocks/tabs-item/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/Blocks/tabs/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "yard/tabs",
"version": "0.1.1",
"version": "0.2.0",
"title": "Tabbladen",
"category": "yard",
"description": "Groepeer gemakkelijk content in verschillende tabbladen.",
Expand Down
2 changes: 1 addition & 1 deletion build/Blocks/tabs/frontend.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'accd9871540637703fab');
<?php return array('dependencies' => array(), 'version' => '99efd052c3eb09c3183e');
2 changes: 1 addition & 1 deletion build/Blocks/tabs/frontend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/Blocks/tabs/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices'), 'version' => '3f3f1993678ce24e6bb3');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices'), 'version' => 'b35152fb80d5d70982ed');
2 changes: 1 addition & 1 deletion build/Blocks/tabs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Blocks/tabs-item/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "yard/tabs-item",
"version": "0.1.1",
"version": "0.2.0",
"title": "Tabblad",
"category": "yard",
"description": "Tabblad item.",
Expand All @@ -27,7 +27,7 @@
"type": "string"
}
},
"parent": ["yard/tabs"],
"parent": [ "yard/tabs" ],
"supports": {
"anchor": true,
"html": false,
Expand Down
40 changes: 16 additions & 24 deletions src/Blocks/tabs-item/save.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
/**
* WordPress dependencies
*/
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
import { InnerBlocks } from '@wordpress/block-editor';

/**
* External dependencies
*/
import { Icon } from '@yardinternet/gutenberg-components';

const Save = ( props ) => {
const { attributes } = props;
const { headingLevel, headingText, icon, id } = attributes;
const HeadingWithLevel = headingLevel;
const Save = ( { attributes } ) => {
const { headingText, icon, id } = attributes;

return (
<>
<HeadingWithLevel
{ ...useBlockProps.save( {
className: 'wp-block-yard-tabs-item__heading',
} ) }
<button
data-tab-button
id={ `tabs-item-button-${ id }` }
role="tab"
className="wp-block-yard-tabs-item__button"
aria-controls={ `tabs-item-panel-${ id }` }
aria-selected="false"
>
<button
id={ `tabs-item-button-${ id }` }
className="wp-block-yard-tabs-item__button"
role="tab"
aria-controls={ `tabs-item-panel-${ id }` }
aria-selected="false"
>
{ icon && <Icon { ...props } /> }
{ headingText }
</button>
</HeadingWithLevel>
{ icon && <Icon icon={ icon } /> }
{ headingText }
</button>

<div
{ ...useBlockProps.save( {
className: 'wp-block-yard-tabs-item__panel',
} ) }
data-tab-panel
id={ `tabs-item-panel-${ id }` }
role="tabpanel"
aria-hidden="true"
className="wp-block-yard-tabs-item"
aria-labelledby={ `tabs-item-button-${ id }` }
hidden
>
<InnerBlocks.Content />
</div>
Expand Down
Loading