From 0642815844f49a89b3cb98079a48acd37734b29a Mon Sep 17 00:00:00 2001 From: Jonathan Elliot Date: Fri, 7 Feb 2020 14:38:55 +0000 Subject: [PATCH] Support outside customisation of menu button and close button props Upversion to 1.1.0 --- package.json | 2 +- src/Header.tsx | 5 ++++- src/Nav.tsx | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 749c4fb..6607a96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@committed/layout", - "version": "1.0.0", + "version": "1.1.0", "description": "Committed layout library", "author": "Committed", "license": "MIT", diff --git a/src/Header.tsx b/src/Header.tsx index 9f41f07..f94e8a9 100644 --- a/src/Header.tsx +++ b/src/Header.tsx @@ -18,6 +18,7 @@ export type HeaderProps = { position?: Position children?: ReactNode toolbarProps?: any + menuButtonProps?: any menuIcon?: { active: ReactNode inactive: ReactNode @@ -82,7 +83,8 @@ const Header = ({ style = {}, color = 'primary', children, - toolbarProps = {} + toolbarProps = {}, + menuButtonProps = {} }: HeaderProps) => { const theme = useTheme() const classes = useStyles() @@ -126,6 +128,7 @@ const Header = ({ color="inherit" onClick={setOpen} className={classes.menuButton} + {...menuButtonProps} > {open ? menuIcon.active : menuIcon.inactive || menuIcon.active} diff --git a/src/Nav.tsx b/src/Nav.tsx index 9be2dbd..c75bf8e 100644 --- a/src/Nav.tsx +++ b/src/Nav.tsx @@ -58,6 +58,7 @@ export interface NavProps { component?: React.ElementType> children?: ReactNode header?: ReactNode + closeButtonProps?: any collapsedIcon?: { active: ReactNode inactive: ReactNode @@ -73,6 +74,7 @@ const Nav = ({ inactive: }, children, + closeButtonProps = {}, ...props }: NavProps) => { const classes = useStyles() @@ -127,6 +129,7 @@ const Nav = ({ className={classes.closeButton} style={{ left: navWidth + 16 }} onClick={setOpen} + {...closeButtonProps} > {collapsedIcon.inactive}