bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/container.jsx
2017-10-10 10:06:34 -03:00

39 lines
889 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { createContainer } from 'meteor/react-meteor-data';
import EmojiService from './service';
import EmojiMenu from './component';
const propTypes = {
// Emoji status of the current user
userEmojiStatus: PropTypes.string.isRequired,
actions: PropTypes.object.isRequired,
};
const EmojiContainer = ({ userEmojiStatus, actions }) => (
<EmojiMenu userEmojiStatus={userEmojiStatus} actions={actions} />
);
export default createContainer(() => {
const data = EmojiService.getEmojiData();
const {
userEmojiStatus,
credentials,
} = data;
const { requesterUserId: userId } = credentials;
return {
userEmojiStatus,
actions: {
setEmojiHandler: (status) => {
EmojiService.setEmoji(userId, status);
},
},
};
}, EmojiContainer);
EmojiContainer.propTypes = propTypes;