From 614dd5102918190cbb90038f8bd5954130b54986 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 16 Feb 2021 13:23:16 +0100 Subject: [PATCH] feature(components): prop-type Menu --- components/common/Menu.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/components/common/Menu.js b/components/common/Menu.js index 6421ba55..91eeee97 100644 --- a/components/common/Menu.js +++ b/components/common/Menu.js @@ -1,8 +1,9 @@ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import styles from './Menu.module.css'; -export default function Menu({ +function Menu({ options = [], selectedOption, className, @@ -46,3 +47,24 @@ export default function Menu({ ); } + +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;