mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
feature(components): prop-type Menu
This commit is contained in:
parent
4ff2bd4fa2
commit
614dd51029
@ -1,8 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import styles from './Menu.module.css';
|
import styles from './Menu.module.css';
|
||||||
|
|
||||||
export default function Menu({
|
function Menu({
|
||||||
options = [],
|
options = [],
|
||||||
selectedOption,
|
selectedOption,
|
||||||
className,
|
className,
|
||||||
@ -46,3 +47,24 @@ export default function Menu({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Menu.propTypes = {
|
||||||
|
options: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
label: PropTypes.node,
|
||||||
|
value: PropTypes.any,
|
||||||
|
className: PropTypes.string,
|
||||||
|
render: PropTypes.func,
|
||||||
|
divider: PropTypes.bool,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
selectedOption: PropTypes.any,
|
||||||
|
className: PropTypes.string,
|
||||||
|
float: PropTypes.oneOf(['top', 'bottom']),
|
||||||
|
align: PropTypes.oneOf(['left', 'right']),
|
||||||
|
optionClassName: PropTypes.string,
|
||||||
|
selectedClassName: PropTypes.string,
|
||||||
|
onSelect: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Menu;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user