// @flow import * as React from 'react'; import classNames from 'classnames'; import { Flyout, Overlay } from '../../components/flyout'; import ScrollWrapper from '../../components/scroll-wrapper'; import type { FlyoutProps } from '../../components/flyout/Flyout'; import './styles/HeaderFlyout.scss'; type Props = FlyoutProps & { /** Components to render in the overlay */ children: ?React.Node, /** Set className to the overlay wrapper */ className?: string, /** Custom button to trigger for opening/closing the flyout */ flyoutButton: React.Element, /** What content to display in the footer */ footer?: React.Element, /** What content to display in the header */ header?: React.Element, /** Optional function to get the scrollRef in parent components */ scrollRefFn?: any => any, }; class HeaderFlyout extends React.Component { static panelOffset = '-4px 0px'; static defaultProps = { position: 'bottom-left', }; render() { const { header, footer, flyoutButton, children, scrollRefFn, className, ...rest } = this.props; return ( {flyoutButton}
{header && (

{header}

)}
{children != null && ( {children} )}
{footer &&
{footer}
}
); } } export default HeaderFlyout;