Removing duplicate back button on root level of new navigation (https://github.com/woocommerce/woocommerce-admin/pull/5915)

This commit is contained in:
Joel Thiessen 2021-01-04 09:00:42 -08:00 committed by GitHub
parent 71877be8dc
commit 750efaef0f
1 changed files with 7 additions and 3 deletions

View File

@ -114,6 +114,8 @@ const Container = ( { menuItems } ) => {
} );
};
const isRootBackVisible = activeLevel === 'woocommerce' && rootBackUrl;
return (
<div className="woocommerce-navigation">
<Header />
@ -129,7 +131,7 @@ const Container = ( { menuItems } ) => {
setActiveLevel( ...args );
} }
>
{ activeLevel === 'woocommerce' && rootBackUrl && (
{ isRootBackVisible && (
<NavigationBackButton
className="woocommerce-navigation__back-to-dashboard"
href={ rootBackUrl }
@ -152,8 +154,10 @@ const Container = ( { menuItems } ) => {
backButtonLabel={
category.backButtonLabel || null
}
onBackButtonClick={ () =>
trackBackClick( category.id )
onBackButtonClick={
isRootBackVisible
? null
: () => trackBackClick( category.id )
}
>
{ !! primaryItems && (