mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
feature(components): prop-type MenuButton
This commit is contained in:
parent
614dd51029
commit
cf87ec1ea5
@ -1,11 +1,12 @@
|
|||||||
import React, { useState, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Menu from 'components/common/Menu';
|
import Menu from 'components/common/Menu';
|
||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import useDocumentClick from 'hooks/useDocumentClick';
|
import useDocumentClick from 'hooks/useDocumentClick';
|
||||||
import styles from './MenuButton.module.css';
|
import styles from './MenuButton.module.css';
|
||||||
|
|
||||||
export default function MenuButton({
|
function MenuButton({
|
||||||
icon,
|
icon,
|
||||||
value,
|
value,
|
||||||
options,
|
options,
|
||||||
@ -58,3 +59,25 @@ export default function MenuButton({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuButton.propTypes = {
|
||||||
|
icon: PropTypes.node,
|
||||||
|
value: PropTypes.any,
|
||||||
|
options: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
label: PropTypes.node,
|
||||||
|
value: PropTypes.any,
|
||||||
|
className: PropTypes.string,
|
||||||
|
render: PropTypes.func,
|
||||||
|
divider: PropTypes.bool,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
buttonClassName: PropTypes.string,
|
||||||
|
menuClassName: PropTypes.string,
|
||||||
|
menuPosition: PropTypes.oneOf(['top', 'bottom']),
|
||||||
|
menuAlign: PropTypes.oneOf(['left', 'right']),
|
||||||
|
onSelect: PropTypes.func,
|
||||||
|
renderValue: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MenuButton;
|
||||||
|
Loading…
Reference in New Issue
Block a user