Skip to content

Commit

Permalink
fix(dashboard): Hide edit rank button when no categories exist (#7986)
Browse files Browse the repository at this point in the history
RESOLVES CORE-2456
  • Loading branch information
kasperkristensen authored Jul 5, 2024
1 parent 50df3ce commit e11716f
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export const CategoryListTable = () => {
pageSize: PAGE_SIZE,
})

const showRankingAction =
!!product_categories && product_categories.length > 0

if (isError) {
throw error
}
Expand All @@ -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>
Expand Down

0 comments on commit e11716f

Please sign in to comment.