Skip to content

Commit

Permalink
fix: syntactic simplifications to Breadcrumbs useMemo and HomepageCon…
Browse files Browse the repository at this point in the history
…tent classnames
  • Loading branch information
jamiehenson committed Feb 13, 2025
1 parent a3db8ef commit 98236b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Homepage/HomepageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type SectionProps = {
};

export const HomepageContent = ({ sections, images }: { sections: SectionProps[]; images: ImageProps[] }) => (
<article className="mx-auto" style={{ maxWidth: '960px' }}>
<article className="mx-auto max-w-[960px]">
{sections.map((section, index) => (
<BodySection key={index} section={section} images={images} />
))}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Layout/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { hierarchicalKey } from './utils/nav';
const Breadcrumbs: React.FC = () => {
const { activePage } = useLayoutContext();

const breadcrumbNodes = useMemo(() => {
return activePage?.tree.filter((node) => node.page.link !== '#') ?? [];
}, [activePage.tree]);
const breadcrumbNodes = useMemo(
() => activePage?.tree.filter((node) => node.page.link !== '#') ?? [],
[activePage.tree],
);

if (breadcrumbNodes.length === 0) {
return null;
Expand Down

0 comments on commit 98236b7

Please sign in to comment.