import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { kinds } from 'Helpers/Props'; import { tagShape } from './TagInput'; import styles from './TagInputInput.css'; class TagInputInput extends Component { onMouseDown = (event) => { event.preventDefault(); const { isFocused, onInputContainerPress } = this.props; if (isFocused) { return; } onInputContainerPress(); } render() { const { className, tags, inputProps, kind, tagComponent: TagComponent, onTagDelete } = this.props; return (
{ tags.map((tag, index) => { return ( ); }) }
); } } TagInputInput.propTypes = { className: PropTypes.string.isRequired, tags: PropTypes.arrayOf(PropTypes.shape(tagShape)).isRequired, inputProps: PropTypes.object.isRequired, kind: PropTypes.oneOf(kinds.all).isRequired, isFocused: PropTypes.bool.isRequired, tagComponent: PropTypes.func.isRequired, onTagDelete: PropTypes.func.isRequired, onInputContainerPress: PropTypes.func.isRequired }; TagInputInput.defaultProps = { className: styles.inputContainer }; export default TagInputInput;