Removing duplicate back button on root level of new navigation (https://github.com/woocommerce/woocommerce-admin/pull/5915)
This commit is contained in:
parent
71877be8dc
commit
750efaef0f
|
@ -114,6 +114,8 @@ const Container = ( { menuItems } ) => {
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isRootBackVisible = activeLevel === 'woocommerce' && rootBackUrl;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="woocommerce-navigation">
|
<div className="woocommerce-navigation">
|
||||||
<Header />
|
<Header />
|
||||||
|
@ -129,7 +131,7 @@ const Container = ( { menuItems } ) => {
|
||||||
setActiveLevel( ...args );
|
setActiveLevel( ...args );
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
{ activeLevel === 'woocommerce' && rootBackUrl && (
|
{ isRootBackVisible && (
|
||||||
<NavigationBackButton
|
<NavigationBackButton
|
||||||
className="woocommerce-navigation__back-to-dashboard"
|
className="woocommerce-navigation__back-to-dashboard"
|
||||||
href={ rootBackUrl }
|
href={ rootBackUrl }
|
||||||
|
@ -152,8 +154,10 @@ const Container = ( { menuItems } ) => {
|
||||||
backButtonLabel={
|
backButtonLabel={
|
||||||
category.backButtonLabel || null
|
category.backButtonLabel || null
|
||||||
}
|
}
|
||||||
onBackButtonClick={ () =>
|
onBackButtonClick={
|
||||||
trackBackClick( category.id )
|
isRootBackVisible
|
||||||
|
? null
|
||||||
|
: () => trackBackClick( category.id )
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{ !! primaryItems && (
|
{ !! primaryItems && (
|
||||||
|
|
Loading…
Reference in New Issue