From 5cbbc82e1816140c218500b4cf59f19ea1107530 Mon Sep 17 00:00:00 2001 From: Peter Pal Hudak Date: Fri, 29 Nov 2024 16:19:26 +0100 Subject: [PATCH] WIP(ui-top-nav-bar): add more changes after review --- packages/__docs__/src/App/index.tsx | 8 +++-- .../ui-top-nav-bar/src/CanvasTopNav/index.tsx | 32 ++++++++++--------- .../ui-top-nav-bar/src/MobileTopNav/index.tsx | 6 ++-- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/packages/__docs__/src/App/index.tsx b/packages/__docs__/src/App/index.tsx index 815a396e90..2b75b5286b 100644 --- a/packages/__docs__/src/App/index.tsx +++ b/packages/__docs__/src/App/index.tsx @@ -1025,7 +1025,7 @@ class App extends Component { > { mobileButtons={[ { screenReaderLabel: 'Analytics', - icon: + icon: , + onClick: () => alert('Analytics clicked') }, { screenReaderLabel: 'Alerts', - icon: + icon: , + onClick: () => alert('Alerts clicked') } ]} mobileMenuBackNavigation={{ href: '#', label: 'Back' }} diff --git a/packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx b/packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx index cdc5bec079..bae16d8826 100644 --- a/packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx +++ b/packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx @@ -76,7 +76,8 @@ const CanvasTopNav = ({ withBackground={false} withBorder={false} screenReaderLabel={button.screenReaderLabel} - color={lightMode ? 'secondary' : button.color} + color={lightMode ? 'primary' : 'primary-inverse'} + onClick={button.onClick} > {button.icon} @@ -87,7 +88,7 @@ const CanvasTopNav = ({
- {mobileMenuTitle} - + {mobileMenu.map((item, index) => ( - - {breadcrumb.links.map((link, index) => - link.href ? ( - - {link.label} - - ) : ( - {link.label} - ) - )} - +
+ + {breadcrumb.links.map((link, index) => + link.href ? ( + + {link.label} + + ) : ( + {link.label} + ) + )} + +
diff --git a/packages/ui-top-nav-bar/src/MobileTopNav/index.tsx b/packages/ui-top-nav-bar/src/MobileTopNav/index.tsx index 8e2daff985..97442980fd 100644 --- a/packages/ui-top-nav-bar/src/MobileTopNav/index.tsx +++ b/packages/ui-top-nav-bar/src/MobileTopNav/index.tsx @@ -76,7 +76,7 @@ const MobileTopNav = ({ withBackground={false} withBorder={false} screenReaderLabel="burgir" - color={lightMode ? 'secondary' : 'primary-inverse'} + color={lightMode ? 'primary' : 'primary-inverse'} onClick={() => setOpen((open) => !open)} > {open ? : } @@ -105,10 +105,12 @@ Title.displayName = 'Title' const ItemList = ({ children, + title, styles -}: PropsWithChildren & { styles: any }) => { +}: PropsWithChildren & { styles: any; title: any }) => { return ( + {title && {title}} {Children.map(children, (child, index) => ( {child}