Separate logic for onboarding and settings

This commit is contained in:
Philipp Stracker 2024-10-28 17:56:23 +01:00
parent dbd37fc282
commit 2bf9832844
No known key found for this signature in database
4 changed files with 51 additions and 36 deletions

View file

@ -1,4 +1,4 @@
import { memo, useCallback, useEffect, useState } from '@wordpress/element';
import { useCallback, useEffect, useState } from '@wordpress/element';
import { TabPanel } from '@wordpress/components';
import { getQuery, updateQueryString } from '@woocommerce/navigation';
@ -18,7 +18,7 @@ const TabNavigation = ( { tabs } ) => {
const [ activePanel, setActivePanel ] = useState( getValidInitialPanel );
const updatePanelUri = useCallback(
const updateActivePanel = useCallback(
( tabName ) => {
if ( isValidTab( tabs, tabName ) ) {
setActivePanel( tabName );
@ -37,7 +37,7 @@ const TabNavigation = ( { tabs } ) => {
<TabPanel
className={ `ppcp-r-tabs ${ activePanel }` }
initialTabName={ activePanel }
onSelect={ updatePanelUri }
onSelect={ updateActivePanel }
tabs={ tabs }
>
{ ( tab ) => {