fix(dashboard): Hide edit rank button when no categories exist (#7986)
RESOLVES CORE-2456
This commit is contained in:
committed by
GitHub
parent
50df3cea00
commit
e11716fa1e
@@ -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 = () => {
|
||||
</Text>
|
||||
</div>
|
||||
<div className="flex items-center gap-x-2">
|
||||
<Button size="small" variant="secondary" asChild>
|
||||
<Link to="organize">{t("categories.organize.action")}</Link>
|
||||
</Button>
|
||||
{showRankingAction && (
|
||||
<Button size="small" variant="secondary" asChild>
|
||||
<Link to="organize">{t("categories.organize.action")}</Link>
|
||||
</Button>
|
||||
)}
|
||||
<Button size="small" variant="secondary" asChild>
|
||||
<Link to="create">{t("actions.create")}</Link>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user