Skip to content

Commit

Permalink
Merge pull request #75 from abusix/pla-899-add-onclick-to-popover-button
Browse files Browse the repository at this point in the history
feat(components): add onClick prop
  • Loading branch information
mnlfischer authored Dec 14, 2023
2 parents 0c4eaf0 + 69c7dd1 commit d40d99b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/navigation/navigation-popover-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import { useNavigationPopoverContext } from "./navigation-popover-context";
export interface NavigationPopoverButtonProps {
LeftIcon?: React.ElementType;
children: React.ReactNode;
onClick?: () => void;
}

export const NavigationPopoverButton = ({ children, LeftIcon }: NavigationPopoverButtonProps) => {
export const NavigationPopoverButton = ({
children,
LeftIcon,
onClick,
}: NavigationPopoverButtonProps) => {
const {
popoverButton: { setReferenceElement },
} = useNavigationPopoverContext();
Expand All @@ -16,6 +21,7 @@ export const NavigationPopoverButton = ({ children, LeftIcon }: NavigationPopove
<Popover.Button
ref={(el) => el && setReferenceElement(el)}
className="flex w-full items-center gap-x-3 px-4 py-3 text-left text-sm text-neutral-0 hover:bg-primary-900+10 ui-open:bg-primary-900+8 ui-open:font-semibold"
onClick={onClick}
>
<>
{LeftIcon && <LeftIcon className="h-4 w-4" />}
Expand Down

0 comments on commit d40d99b

Please sign in to comment.