import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, intlShape, injectIntl } from 'react-intl'; import Button from '/imports/ui/components/button/component'; import Dropdown from '/imports/ui/components/dropdown/component'; import DropdownTrigger from '/imports/ui/components/dropdown/trigger/component'; import DropdownContent from '/imports/ui/components/dropdown/content/component'; import DropdownList from '/imports/ui/components/dropdown/list/component'; import DropdownListItem from '/imports/ui/components/dropdown/list/item/component'; import DropdownListSeparator from '/imports/ui/components/dropdown/list/separator/component'; import { styles } from '../styles'; const intlMessages = defineMessages({ statusTriggerLabel: { id: 'app.actionsBar.emojiMenu.statusTriggerLabel', description: 'Emoji status button label', }, changeStatusLabel: { id: 'app.actionsBar.changeStatusLabel', description: 'Aria-label for emoji status button', }, currentStatusDesc: { id: 'app.actionsBar.currentStatusDesc', description: 'Aria description for status button', }, }); const propTypes = { intl: intlShape.isRequired, options: PropTypes.objectOf(PropTypes.string).isRequired, selected: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired, }; const EmojiSelect = ({ intl, options, selected, onChange, }) => { const statuses = Object.keys(options); const lastStatus = statuses.pop(); const statusLabel = intl.formatMessage(intlMessages.statusTriggerLabel); return ( { statuses.map(status => ( onChange(status)} tabIndex={-1} /> )) .concat( , onChange(lastStatus)} tabIndex={-1} />, ) } ); }; EmojiSelect.propTypes = propTypes; export default injectIntl(EmojiSelect);