Skip to content

Commit

Permalink
it has to be passed to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
jivey committed Aug 29, 2024
1 parent 53b3d1f commit 8cb782c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/SidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ type FunctionRender = (_: {
}) => React.ReactNode;

interface SidebarNavSharedProps {
id?: string;
navHeader?: React.ReactNode | FunctionRender;
navFooter?: React.ReactNode | FunctionRender;
children: React.ReactNode | FunctionRender;
Expand Down Expand Up @@ -253,13 +254,14 @@ export const SidebarNavBase = ({
};

export const SidebarNav = styled(
({ className, ...props }: SidebarNavSharedProps) => {
({ className, id, ...props }: SidebarNavSharedProps) => {
const { isMobile, navIsCollapsed, setNavIsCollapsed } =
useSidebarNavProps(props);
const sidebarNavRef = React.useRef<HTMLElement>(null);

return (
<nav
id={id}
ref={sidebarNavRef}
data-testid="sidebarnav"
className={classNames(className, {
Expand All @@ -284,7 +286,7 @@ export const SidebarNav = styled(
`;

export const BodyPortalSidebarNav = styled(
({ className, ...props }: SidebarNavSharedProps) => {
({ className, id, ...props }: SidebarNavSharedProps) => {
const { isMobile, navIsCollapsed, setNavIsCollapsed } =
useSidebarNavProps(props);

Expand All @@ -311,6 +313,7 @@ export const BodyPortalSidebarNav = styled(

return (
<BodyPortal
id={id}
externalRef={ref}
tagName="nav"
slot="sidebar"
Expand Down

0 comments on commit 8cb782c

Please sign in to comment.