Skip to content

Commit 99c4ebb

Browse files
authored
Refactor ComponentList to simplify rendering logic and remove unneces… (#263)
…sary fragment The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer: - [x] Meaningful pull request title for the release notes - [x] Pull request is linked to an issue and all changes relate to the issue - [x] Tests to protect this code implemented (if applicable) - [ ] Manual test performed successfully (if applicable) - [x] Documentation or migration has been updated (if applicable)
2 parents 4f483c5 + 35b46ff commit 99c4ebb

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/components/docs/ComponentList.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,18 @@ export const ComponentList: FC<Props> = ({ lang }) => {
8989
}),
9090
[]
9191
);
92-
if (components?.length <= 0) return null;
9392
return (
94-
<>
95-
<div className="components-overview">
96-
{components.map(({ name, loadComponent }) => (
97-
<LazyLoadComponent
98-
key={name}
99-
name={name}
100-
lang={lang}
101-
path={(docVersion?.preferredVersion?.path as string) ?? '/docs'}
102-
loadComponent={loadComponent}
103-
observer={observer}
104-
/>
105-
))}
106-
</div>
107-
</>
93+
<div className="components-overview">
94+
{components?.map(({ name, loadComponent }) => (
95+
<LazyLoadComponent
96+
key={name}
97+
name={name}
98+
lang={lang}
99+
path={(docVersion?.preferredVersion?.path as string) ?? '/docs'}
100+
loadComponent={loadComponent}
101+
observer={observer}
102+
/>
103+
))}
104+
</div>
108105
);
109106
};

0 commit comments

Comments
 (0)