Skip to content

Commit

Permalink
chore(docs): fix bug in demo causing tiles to not show as selected
Browse files Browse the repository at this point in the history
  • Loading branch information
wise-king-sullyman committed Jun 24, 2024
1 parent a5662e3 commit 1353685
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/dev/src/CustomCatalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ export const CustomCatalog: React.FC = () => {
setFilteredQuickStarts(result);
};

const CatalogWithSections = React.useMemo(
() => (
const CatalogWithSections = (
<>
<QuickStartCatalogSection>
<TextContent>
Expand Down Expand Up @@ -141,9 +140,7 @@ export const CustomCatalog: React.FC = () => {
<Divider />
</QuickStartCatalogSection>
</>
),
[activeQuickStartID, allQuickStartStates, allQuickStarts],
);
);

const clearFilters = React.useCallback(() => {
setFilter('keyword', '');
Expand All @@ -156,7 +153,7 @@ export const CustomCatalog: React.FC = () => {
);
}, [allQuickStarts, setFilter]);

const quickStartCatalog = React.useMemo(() => {
const quickStartCatalog = () => {
if (filteredQuickStarts.length === 0) {
return <QuickStartCatalogEmptyState clearFilters={clearFilters} />;
}
Expand All @@ -166,7 +163,7 @@ export const CustomCatalog: React.FC = () => {
}

return CatalogWithSections;
}, [CatalogWithSections, allQuickStarts.length, clearFilters, filteredQuickStarts]);
};

if (loading) {
return <LoadingBox />;
Expand All @@ -184,7 +181,7 @@ export const CustomCatalog: React.FC = () => {
</ToolbarContent>
</QuickStartCatalogToolbar>
<Divider component="div" />
{quickStartCatalog}
{quickStartCatalog()}
</>
);
};

0 comments on commit 1353685

Please sign in to comment.