From 750efaef0fae1a83f00a6bd1b20c0198341124f8 Mon Sep 17 00:00:00 2001 From: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com> Date: Mon, 4 Jan 2021 09:00:42 -0800 Subject: [PATCH] Removing duplicate back button on root level of new navigation (https://github.com/woocommerce/woocommerce-admin/pull/5915) --- .../client/navigation/components/container/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce-admin/client/navigation/components/container/index.js b/plugins/woocommerce-admin/client/navigation/components/container/index.js index a945f9fa659..d4b8d2141aa 100644 --- a/plugins/woocommerce-admin/client/navigation/components/container/index.js +++ b/plugins/woocommerce-admin/client/navigation/components/container/index.js @@ -114,6 +114,8 @@ const Container = ( { menuItems } ) => { } ); }; + const isRootBackVisible = activeLevel === 'woocommerce' && rootBackUrl; + return (
@@ -129,7 +131,7 @@ const Container = ( { menuItems } ) => { setActiveLevel( ...args ); } } > - { activeLevel === 'woocommerce' && rootBackUrl && ( + { isRootBackVisible && ( { backButtonLabel={ category.backButtonLabel || null } - onBackButtonClick={ () => - trackBackClick( category.id ) + onBackButtonClick={ + isRootBackVisible + ? null + : () => trackBackClick( category.id ) } > { !! primaryItems && (