Skip to content

Commit

Permalink
Added url prop to Menu (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Sep 21, 2021
1 parent 3dbb434 commit 9d65aae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion react/src/lib/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type MenuProps = {
menuBarPosition?: "top" | "left" | "right" | "bottom";
menuDrawerPosition?: "left" | "right";
showLogo?: boolean;
url?: string;
setProps?: (props: ParentProps) => void;
};

Expand Down Expand Up @@ -218,7 +219,7 @@ export const Menu: React.FC<MenuProps> = (props) => {
);

return (
<div className="Menu">
<div className="Menu" id={props.id}>
<Overlay visible={open && !pinned} onClick={() => setOpen(false)} />
<MenuBar
position={menuBarPosition as MenuBarPosition}
Expand Down Expand Up @@ -286,6 +287,11 @@ Menu.propTypes = {
* A list of navigation items to show in the menu.
*/
navigationItems: PropTypes.any.isRequired,

/**
* Currently selected URL. Leave blank.
*/
url: PropTypes.string,
};

Menu.defaultProps = {
Expand All @@ -297,4 +303,5 @@ Menu.defaultProps = {
showLogo: true,
menuBarPosition: "left",
menuDrawerPosition: "left",
url: "",
};

0 comments on commit 9d65aae

Please sign in to comment.