Skip to content

Commit

Permalink
WIP(ui-top-nav-bar): add more changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
joyenjoyer committed Dec 2, 2024
1 parent a97ebf4 commit 5cbbc82
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
8 changes: 5 additions & 3 deletions packages/__docs__/src/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ class App extends Component<AppProps, AppState> {
>
<CanvasTopNav
brand={brandSvg}
lightMode={true}
lightMode={false}
breadcrumb={{
label: 'You are here:',
links: [
Expand All @@ -1039,11 +1039,13 @@ class App extends Component<AppProps, AppState> {
mobileButtons={[
{
screenReaderLabel: 'Analytics',
icon: <IconAnalyticsLine />
icon: <IconAnalyticsLine />,
onClick: () => alert('Analytics clicked')
},
{
screenReaderLabel: 'Alerts',
icon: <IconAlertsLine />
icon: <IconAlertsLine />,
onClick: () => alert('Alerts clicked')
}
]}
mobileMenuBackNavigation={{ href: '#', label: 'Back' }}
Expand Down
32 changes: 17 additions & 15 deletions packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
</IconButton>
Expand All @@ -87,7 +88,7 @@ const CanvasTopNav = ({
<BreadcrumbLink
href={mobileMenuBackNavigation.href}
isWithinText={false}
color={lightMode ? 'link' : 'link-inverse'}
color={lightMode ? 'link' : 'primary-inverse'}

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

No overload matches this call.

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

No overload matches this call.

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

No overload matches this call.

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

No overload matches this call.

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

No overload matches this call.

Check failure on line 91 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

No overload matches this call.
>
<div
style={{
Expand All @@ -101,8 +102,7 @@ const CanvasTopNav = ({
</div>
</BreadcrumbLink>
</Breadcrumb>
<MobileTopNav.Title>{mobileMenuTitle}</MobileTopNav.Title>
<MobileTopNav.ItemList>
<MobileTopNav.ItemList title={mobileMenuTitle}>
{mobileMenu.map((item, index) => (

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

Parameter 'index' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

Parameter 'index' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

Parameter 'item' implicitly has an 'any' type.

Check failure on line 106 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

Parameter 'index' implicitly has an 'any' type.
<MobileTopNav.Item
key={index}
Expand All @@ -128,17 +128,19 @@ const CanvasTopNav = ({
>
<IconHamburgerLine />
</IconButton>
<Breadcrumb label={breadcrumb.label}>
{breadcrumb.links.map((link, index) =>
link.href ? (
<Breadcrumb.Link key={index} href={link.href}>
{link.label}
</Breadcrumb.Link>
) : (
<Breadcrumb.Link key={index}>{link.label}</Breadcrumb.Link>
)
)}
</Breadcrumb>
<div style={{ minWidth: '100%' }}>
<Breadcrumb label={breadcrumb.label}>
{breadcrumb.links.map((link, index) =>

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

Parameter 'index' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

Parameter 'index' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

Parameter 'index' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

Parameter 'link' implicitly has an 'any' type.

Check failure on line 133 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

Parameter 'index' implicitly has an 'any' type.
link.href ? (
<Breadcrumb.Link key={index} href={link.href}>
{link.label}
</Breadcrumb.Link>
) : (
<Breadcrumb.Link key={index}>{link.label}</Breadcrumb.Link>
)
)}
</Breadcrumb>
</div>
</DesktopTopNav.Start>
<DesktopTopNav.End>
<Button renderIcon={IconAddLine}>IconAddLine</Button>

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Vitest unit tests

No overload matches this call.

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / chromatic_deployment

No overload matches this call.

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Legacy unit tests

No overload matches this call.

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Cypress component tests

No overload matches this call.

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / deploy-preview

No overload matches this call.

Check failure on line 146 in packages/ui-top-nav-bar/src/CanvasTopNav/index.tsx

View workflow job for this annotation

GitHub Actions / Lint commit msg + code

No overload matches this call.
Expand Down
6 changes: 4 additions & 2 deletions packages/ui-top-nav-bar/src/MobileTopNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? <IconXLine /> : <IconHamburgerLine />}
Expand Down Expand Up @@ -105,10 +105,12 @@ Title.displayName = 'Title'

const ItemList = ({
children,
title,
styles
}: PropsWithChildren & { styles: any }) => {
}: PropsWithChildren & { styles: any; title: any }) => {
return (
<Fragment>
{title && <Title>{title}</Title>}
{Children.map(children, (child, index) => (
<Fragment>
{child}
Expand Down

0 comments on commit 5cbbc82

Please sign in to comment.