mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-04 11:41:09 +00:00
strict Popup proptypes defined
This commit is contained in:
parent
91aaa860f4
commit
bdaeed2736
3 changed files with 24 additions and 3 deletions
|
|
@ -1,9 +1,18 @@
|
|||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
|
||||
const Label = React.forwardRef(({ children, ...props }, ref) => {
|
||||
return React.cloneElement(React.Children.only(children), { ...props, ref });
|
||||
const Label = React.forwardRef(({ children, onClick }, ref) => {
|
||||
return React.cloneElement(React.Children.only(children), { ref, onClick });
|
||||
});
|
||||
|
||||
Label.displayName = 'Popup.Label';
|
||||
|
||||
Label.propTypes = {
|
||||
onClick: PropTypes.func,
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
])
|
||||
};
|
||||
|
||||
module.exports = Label;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
|
||||
const Menu = React.forwardRef(({ children }, ref) => (
|
||||
<div ref={ref}>
|
||||
|
|
@ -8,4 +9,11 @@ const Menu = React.forwardRef(({ children }, ref) => (
|
|||
|
||||
Menu.displayName = 'Popup.Menu';
|
||||
|
||||
Menu.propTypes = {
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
])
|
||||
};
|
||||
|
||||
module.exports = Menu;
|
||||
|
|
|
|||
|
|
@ -290,7 +290,11 @@ Popup.Menu = Menu;
|
|||
Popup.propTypes = {
|
||||
modalContainerClassName: PropTypes.string,
|
||||
onOpen: PropTypes.func,
|
||||
onClose: PropTypes.func
|
||||
onClose: PropTypes.func,
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
])
|
||||
};
|
||||
|
||||
module.exports = Popup;
|
||||
|
|
|
|||
Loading…
Reference in a new issue