Skip to content

Commit

Permalink
fix blogpostitem + htmlnavbaritem?
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Oct 25, 2023
1 parent 7ad29c0 commit 5ccf8fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ function useContainerClassName() {
return !isBlogPostPage ? 'margin-bottom--xl' : undefined;
}

function clsx2(...args: Parameters<typeof clsx>): string | undefined {
const result = clsx(args);
if (result === '') {
return undefined;
}
return result;
}

export default function BlogPostItem({
children,
className,
}: Props): JSX.Element {
const containerClassName = useContainerClassName();
return (
<BlogPostItemContainer className={clsx(containerClassName, className)}>
<BlogPostItemContainer className={clsx2(containerClassName, className)}>
<BlogPostItemHeader />
<BlogPostItemContent>{children}</BlogPostItemContent>
<BlogPostItemFooter />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import clsx from 'clsx';

import type {Props} from '@theme/NavbarItem/HtmlNavbarItem';

function clsx2(...args: Parameters<typeof clsx>): string | undefined {
const result = clsx(args);
if (result === '') {
return undefined;
}
return result;
}

export default function HtmlNavbarItem({
value,
className,
Expand All @@ -19,7 +27,7 @@ export default function HtmlNavbarItem({
const Comp = isDropdownItem ? 'li' : 'div';
return (
<Comp
className={clsx(
className={clsx2(
{
navbar__item: !mobile && !isDropdownItem,
'menu__list-item': mobile,
Expand Down

0 comments on commit 5ccf8fc

Please sign in to comment.