Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lilia1891 committed Nov 25, 2024
1 parent 0f70fd6 commit c01fc38
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions components/common/SiteFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,21 @@ function SiteFooter(props: SiteFooterProps) {
{navItems &&
navItems.map((page) => (
<FooterNavItem key={page.id}>
{page.children && page.children.length > 0 ? (
{!page.children?.length && page.slug && (
<NavigationLink slug={page.slug} className="parent-item">
<>
{theme?.navLinkIcons && (
<Icon.AngleRight
color={theme.footerColor}
aria-hidden="true"
className="me-1"
/>
)}
{page.name}
</>
</NavigationLink>
)}
{page.children?.length > 0 && (
<>
<span className="parent-item">{page.name}</span>
<FooterSubnav>
Expand All @@ -543,10 +557,6 @@ function SiteFooter(props: SiteFooterProps) {
))}
</FooterSubnav>
</>
) : (
<NavigationLink slug={page.slug} className="parent-item">
{page.name}
</NavigationLink>
)}
</FooterNavItem>
))}
Expand Down

0 comments on commit c01fc38

Please sign in to comment.