fix(dashboard): Hide edit rank button when no categories exist (#7986)
RESOLVES CORE-2456
This commit is contained in:
1 parent
50df3cea00
commit
e11716fa1e
1 file changed
+5
+5
@@ -57,6 +57,9 @@ export const CategoryListTable = () => {
|
|||||||
pageSize: PAGE_SIZE,
|
pageSize: PAGE_SIZE,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const showRankingAction =
|
||||||
|
!!product_categories && product_categories.length > 0
|
||||||
|
|
||||||
if (isError) {
|
if (isError) {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
@@ -71,9 +74,11 @@ export const CategoryListTable = () => {
|
|||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-x-2">
|
<div className="flex items-center gap-x-2">
|
||||||
|
{showRankingAction && (
|
||||||
<Button size="small" variant="secondary" asChild>
|
<Button size="small" variant="secondary" asChild>
|
||||||
<Link to="organize">{t("categories.organize.action")}</Link>
|
<Link to="organize">{t("categories.organize.action")}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
<Button size="small" variant="secondary" asChild>
|
<Button size="small" variant="secondary" asChild>
|
||||||
<Link to="create">{t("actions.create")}</Link>
|
<Link to="create">{t("actions.create")}</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user