// @flow import * as React from "react"; import { Container, Site, Notification, AccountDropdown } from "../"; import type { Props as NotificationTrayProps } from "../Notification/NotificationTray.react"; import type { Props as AccountDropdownProps } from "../AccountDropdown/AccountDropdown.react"; export type Props = {| +children?: React.Node, /** * header alignment */ +align?: string, /** * href attribute for the logo */ +href?: string, /** * Logo image URL */ +imageURL?: string, /** * The logo alt attribute */ +alt?: string, /** * Include a notifications tray */ +notificationsTray?: NotificationTrayProps, +accountDropdown?: AccountDropdownProps, +navItems?: React.Node, /** * Handle toggling/collapsing of the mobile menu when the collapse icon is clicked */ +onMenuToggleClick?: () => void, |}; /** * The very top header bar of your website, containing the logo and some optional * action components, such as a NotificationTray or an AccountDropdown on the right hand side */ const SiteHeader = ({ children, href, align, imageURL, alt, notificationsTray: notificationsTrayFromProps, accountDropdown: accountDropdownFromProps, navItems, onMenuToggleClick, }: Props): React.Node => { const notificationsTray = notificationsTrayFromProps && React.createElement(Notification.Tray, notificationsTrayFromProps); const accountDropdown = accountDropdownFromProps && React.createElement(AccountDropdown, accountDropdownFromProps); return (
); }; SiteHeader.displayName = "Site.Header"; export default SiteHeader;