Skip to content

Commit

Permalink
Remove categoryObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Dec 18, 2024
1 parent 52b7849 commit 45ec9af
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ export function PatternCategoryPreviews( {
]
);

const categoryObject = availableCategories.find(
( { name } ) => name === category.name
);

const pagingProps = usePatternsPaging(
currentCategoryPatterns,
categoryObject,
category,
scrollContainerRef
);
const { changePage } = pagingProps;
Expand Down Expand Up @@ -153,7 +149,7 @@ export function PatternCategoryPreviews( {
level={ 4 }
as="div"
>
{ categoryObject?.label }
{ category?.label }
</Heading>
</FlexBlock>
<PatternsFilter
Expand All @@ -162,7 +158,7 @@ export function PatternCategoryPreviews( {
setPatternSyncFilter={ onSetPatternSyncFilter }
setPatternSourceFilter={ onSetPatternSourceFilter }
scrollContainerRef={ scrollContainerRef }
category={ categoryObject }
category={ category }
/>
</HStack>
{ ! currentCategoryPatterns.length && (
Expand All @@ -188,9 +184,9 @@ export function PatternCategoryPreviews( {
blockPatterns={ pagingProps.categoryPatterns }
onClickPattern={ onClickPattern }
onHover={ onHover }
label={ categoryObject.label }
label={ category.label }
orientation="vertical"
category={ categoryObject.name }
category={ category.name }
isDraggable
showTitlesAsTooltip={ showTitlesAsTooltip }
patternFilter={ patternSourceFilter }
Expand Down

0 comments on commit 45ec9af

Please sign in to comment.