Skip to content

Commit

Permalink
chore: add tab switch to progress & circle
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 23, 2023
1 parent 9b52b96 commit b8bc734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/blocks/blocks/circle-counter/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Fragment, useState } from '@wordpress/element';
* Internal dependencies
*/
import { InspectorHeader } from '../../components';
import { useTabSwitch } from '../../helpers/block-utility';

/**
*
Expand All @@ -40,7 +41,7 @@ const Inspector = ({
setAttributes
}) => {

const [ tab, setTab ] = useState( 'settings' ); // TODO: After #1801 is merged, use `useTabState` hook.
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const onPercentageChange = value => {
if ( value === undefined ) {
Expand Down
3 changes: 2 additions & 1 deletion src/blocks/blocks/progress-bar/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Fragment, useState } from '@wordpress/element';
* Internal dependencies
*/
import { InspectorHeader } from '../../components';
import { useTabSwitch } from '../../helpers/block-utility';


const defaultFontSizes = [
Expand Down Expand Up @@ -66,7 +67,7 @@ const Inspector = ({
setHeightMode
}) => {

const [ tab, setTab ] = useState( 'settings' ); // TODO: After #1801 is merged, use `useTabState` hook.
const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' );

const onPercentageChange = value => {
if ( value === undefined ) {
Expand Down

0 comments on commit b8bc734

Please sign in to comment.