diff --git a/packages/css/src/components/header/header.scss b/packages/css/src/components/header/header.scss index 1b3b9d7ee3..f8e729cf4f 100644 --- a/packages/css/src/components/header/header.scss +++ b/packages/css/src/components/header/header.scss @@ -80,8 +80,17 @@ } } -.ams-header__mega-menu--closed.ams-header__mega-menu--closed { - display: none; +.ams-mega-menu { inline-size: 100%; pointer-events: auto; } + +.ams-mega-menu--closed.ams-mega-menu--closed { + display: none; +} + +.ams-mega-menu__secondary-link-list { + @media screen and (min-width: $ams-breakpoint-medium) { + display: none; + } +} diff --git a/packages/react/src/Header/Header.tsx b/packages/react/src/Header/Header.tsx index 9323bc6ba2..5ef1b44325 100644 --- a/packages/react/src/Header/Header.tsx +++ b/packages/react/src/Header/Header.tsx @@ -6,7 +6,7 @@ import { MenuIcon } from '@amsterdam/design-system-react-icons' import clsx from 'clsx' import { forwardRef, useContext } from 'react' -import type { AnchorHTMLAttributes, ForwardedRef, HTMLAttributes, PropsWithChildren, ReactNode } from 'react' +import type { AnchorHTMLAttributes, ForwardedRef, HTMLAttributes, PropsWithChildren } from 'react' import { Grid } from '../Grid' import { Heading } from '../Heading' import { Icon } from '../Icon' @@ -18,35 +18,32 @@ import { MegaMenuListCategory } from '../MegaMenu/MegaMenuListCategory' // import { MegaMenu } from '../MegaMenu' type HeaderNavigationProps = { - children: ReactNode logoBrand: LogoBrand appName?: string label?: string -} +} & PropsWithChildren // TODO: hier willen we misschien een los component van maken, geen subcomponent van Header. // Als je geen mega menu hebt, dan hoef je ook niet logo en app na te maken en context in te laden e.d. // Als we er een subcomponent van maken, dan kun je 'm gelijk niet meer als server component gebruiken denk ik -const HeaderNavigation = ({ children, logoBrand, appName, label = 'Hoofdnavigatie' }: HeaderNavigationProps) => { - return ( - +) -const HeaderMenu = ({ children }: { children: ReactNode }) => +const HeaderMenu = ({ children }: PropsWithChildren) => type HeaderMenuLinkProps = { secondary?: boolean @@ -85,13 +82,22 @@ const MegaMenu = ({ children }: PropsWithChildren) => { const { open } = useContext(HeaderNavigationContext) return ( - + {children} ) } -// TODO: MegaMenuSecondaryLinkList maken, lijstje met links die worden getoond op kleinere schermen. +const MegaMenuSecondaryLinkList = ({ children }: PropsWithChildren) => ( + {children} +) + +const MegaMenuSecondaryLinkListLink = ({ + children, + ...restProps +}: PropsWithChildren>) => ( + {children} +) export type HeaderProps = { /** A site-wide title for the website or application. */ @@ -102,8 +108,6 @@ export type HeaderProps = { logoLink?: string /** The accessible text for the link on the logo. */ logoLinkTitle?: string - /** A secondary menu of links and buttons. Use a Page Menu. Can include buttons to show the Mega Menu or a Search Field. */ - menu?: ReactNode } & HTMLAttributes export const Header = forwardRef( @@ -144,6 +148,12 @@ export const Header = forwardRef( + + + English + + Mijn Amsterdam + Alle onderwerpen