From e11716fa1e1322c01b62434f975730f37d23e1d6 Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Fri, 5 Jul 2024 19:42:02 +0200 Subject: [PATCH] fix(dashboard): Hide edit rank button when no categories exist (#7986) RESOLVES CORE-2456 --- .../category-list-table/category-list-table.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/admin-next/dashboard/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx b/packages/admin-next/dashboard/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx index 0aae05dc54c58..4eb7d3d830a5a 100644 --- a/packages/admin-next/dashboard/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +++ b/packages/admin-next/dashboard/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx @@ -57,6 +57,9 @@ export const CategoryListTable = () => { pageSize: PAGE_SIZE, }) + const showRankingAction = + !!product_categories && product_categories.length > 0 + if (isError) { throw error } @@ -71,9 +74,11 @@ export const CategoryListTable = () => {
- + {showRankingAction && ( + + )}