From 126b28d43259b76372ad885f28c1bea53b51b1bf Mon Sep 17 00:00:00 2001 From: gcampes Date: Tue, 5 Apr 2016 11:24:48 -0300 Subject: [PATCH] Adds emoji status icons to the react user list component --- .../imports/react/components/EmojiIcon.jsx | 76 +++++++++++++++++++ .../components/UserList/UserListItem.jsx | 7 ++ 2 files changed, 83 insertions(+) create mode 100644 bigbluebutton-html5/client/imports/react/components/EmojiIcon.jsx diff --git a/bigbluebutton-html5/client/imports/react/components/EmojiIcon.jsx b/bigbluebutton-html5/client/imports/react/components/EmojiIcon.jsx new file mode 100644 index 0000000000..e580321a54 --- /dev/null +++ b/bigbluebutton-html5/client/imports/react/components/EmojiIcon.jsx @@ -0,0 +1,76 @@ +import classNames from 'classnames'; + +const { PropTypes } = React; + +export let EmojiIcon = React.createClass({ + propTypes: { + iconName: PropTypes.string.isRequired, + }, + + render() { + return this.renderIcon(); + }, + + renderIcon() { + if(this.props.iconName === 'raiseHand') { + return (); + } + else if(this.props.iconName === 'happy') { + return ( + + + + + + + ) + } + else if(this.props.iconName === 'neutral') { + return ( + + + + + + + ) + } + else if(this.props.iconName === 'confused') { + return ( + + + + + + + ) + } + else if(this.props.iconName === 'sad') { + return ( + + + + + + + ) + } + else if(this.props.iconName === 'away') { + return ( + + + + + + ) + } + else if(this.props.iconName === 'plus') { + return ( + + + + + ) + } + }, +}); diff --git a/bigbluebutton-html5/client/imports/react/components/UserList/UserListItem.jsx b/bigbluebutton-html5/client/imports/react/components/UserList/UserListItem.jsx index dd9196ae97..77d1c62f54 100755 --- a/bigbluebutton-html5/client/imports/react/components/UserList/UserListItem.jsx +++ b/bigbluebutton-html5/client/imports/react/components/UserList/UserListItem.jsx @@ -1,5 +1,6 @@ import {Button} from '../Button.jsx'; import {Icon} from '../Icon.jsx'; +import {EmojiIcon} from '../EmojiIcon.jsx'; import {Tooltip} from '../Tooltip.jsx'; import classNames from 'classnames'; @@ -41,6 +42,12 @@ export let UserListItem = React.createClass({ const user = this.props.user; let statusIcons = []; + if(user.emoji !== 'none' && !user.isPresenter) { + statusIcons.push(( + + )); + } + if (this.props.currentUser.isModerator && !user.isPresenter) { statusIcons.push((