bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/dropdown/content/component.jsx

42 lines
847 B
React
Raw Normal View History

import React, { Component, Children, cloneElement } from 'react';
2021-11-10 01:24:42 +08:00
import Styled from './styles';
const defaultProps = {
'aria-expanded': false,
};
export default class DropdownContent extends Component {
render() {
const {
children,
dropdownToggle,
dropdownShow,
dropdownHide,
dropdownIsOpen,
keepOpen,
...restProps
} = this.props;
const boundChildren = Children.map(children, child => cloneElement(child, {
dropdownIsOpen,
2017-06-03 03:25:02 +08:00
dropdownToggle,
dropdownShow,
dropdownHide,
keepOpen,
}));
return (
2021-11-10 01:24:42 +08:00
<Styled.Content
data-test="dropdownContent"
{...restProps}
2017-06-03 03:25:02 +08:00
>
2021-11-10 01:24:42 +08:00
<Styled.Scrollable>
{boundChildren}
2021-11-10 01:24:42 +08:00
</Styled.Scrollable>
</Styled.Content>
);
}
}
DropdownContent.defaultProps = defaultProps;