diff --git a/ui/src/shared/components/DropdownMenu.js b/ui/src/shared/components/DropdownMenu.js deleted file mode 100644 index bdb007593..000000000 --- a/ui/src/shared/components/DropdownMenu.js +++ /dev/null @@ -1,153 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import {Link} from 'react-router' - -import classnames from 'classnames' -import {DROPDOWN_MENU_MAX_HEIGHT} from 'shared/constants/index' -import FancyScrollbar from 'shared/components/FancyScrollbar' - -// AddNewResource is an optional parameter that takes the user to another -// route defined by url prop -const AddNewButton = ({url, text}) => ( -
  • - - {text} - -
  • -) - -const DropdownMenu = ({ - items, - addNew, - actions, - selected, - onAction, - menuClass, - menuWidth, - menuLabel, - onSelection, - onHighlight, - useAutoComplete, - highlightedItemIndex, -}) => { - return ( - - ) -} - -export const DropdownMenuEmpty = ({useAutoComplete, menuClass}) => ( - -) - -const {arrayOf, bool, number, shape, string, func} = PropTypes - -AddNewButton.propTypes = { - url: string, - text: string, -} - -DropdownMenuEmpty.propTypes = { - useAutoComplete: bool, - menuClass: string, -} - -DropdownMenu.propTypes = { - onAction: func, - actions: arrayOf( - shape({ - icon: string.isRequired, - text: string.isRequired, - handler: func.isRequired, - }) - ), - items: arrayOf( - shape({ - text: string.isRequired, - }) - ).isRequired, - onClick: func, - addNew: shape({ - url: string.isRequired, - text: string.isRequired, - }), - selected: string.isRequired, - iconName: string, - className: string, - buttonColor: string, - menuWidth: string, - menuLabel: string, - menuClass: string, - useAutoComplete: bool, - disabled: bool, - searchTerm: string, - onSelection: func, - onHighlight: func, - highlightedItemIndex: number, -} - -export default DropdownMenu diff --git a/ui/src/shared/components/DropdownMenu.tsx b/ui/src/shared/components/DropdownMenu.tsx index cbfb6d2ba..c4cdd3652 100644 --- a/ui/src/shared/components/DropdownMenu.tsx +++ b/ui/src/shared/components/DropdownMenu.tsx @@ -1,5 +1,4 @@ import React, {SFC} from 'react' -import PropTypes from 'prop-types' import {Link} from 'react-router' import classnames from 'classnames'