import * as React from "react"; import * as PropTypes from "prop-types"; import FlyoutContent from "../FlyoutContent"; export interface DataProps {} export interface FlyoutProps extends DataProps, React.HTMLAttributes {} export class Flyout extends React.Component { static contextTypes = { theme: PropTypes.object }; context: { theme: ReactUWP.ThemeType }; render() { const { style, children, ...attributes } = this.props; const { theme } = this.context; const flyoutContents: FlyoutContent[] = []; const renderChild: any[] = []; React.Children.map(children, (child: any) => { if (child.type === FlyoutContent) { flyoutContents.push(child); } else { renderChild.push(child); } }); return (
{flyoutContents} {renderChild}
); } } export default Flyout;