* Implement server changes for group messaging * Majority of client-side implementation * Some server updates * Added new React multiselect component * Fix style issues * Add custom renderer for options * Fix model test * Update ENTER functionality for multiselect control * Remove buttons from multiselect UI control * Updating group messaging UI (#5524) * Move filter controls up a component level * Scroll with arrow keys * Updating mobile layout for multiselect (#5534) * Fix race condition when backspacing quickly * Hidden or new GMs show up for regular messages * Add overriding of number remaining text * Add UI filtering for team if config setting set * Add icon to channel switcher and class prop to status icon * Minor updates per feedback * Improving group messaging UI (#5563) * UX changes per feedback * Update email for group messages * UI fixes for group messaging (#5587) * Fix missing localization string * Add maximum users message when adding members to GM * Fix input clearing on Android * Updating group messaging UI (#5603) * Updating UI for group messaging (#5604)
53 строки
1.4 KiB
JavaScript
53 строки
1.4 KiB
JavaScript
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import Constants from 'utils/constants.jsx';
|
|
|
|
import React from 'react';
|
|
|
|
export default class StatusIcon extends React.Component {
|
|
render() {
|
|
const status = this.props.status;
|
|
const type = this.props.type;
|
|
|
|
if (!status) {
|
|
return null;
|
|
}
|
|
|
|
let statusIcon = '';
|
|
if (type === 'avatar') {
|
|
if (status === 'online') {
|
|
statusIcon = Constants.ONLINE_AVATAR_SVG;
|
|
} else if (status === 'away') {
|
|
statusIcon = Constants.AWAY_AVATAR_SVG;
|
|
} else {
|
|
statusIcon = Constants.OFFLINE_AVATAR_SVG;
|
|
}
|
|
} else if (status === 'online') {
|
|
statusIcon = Constants.ONLINE_ICON_SVG;
|
|
} else if (status === 'away') {
|
|
statusIcon = Constants.AWAY_ICON_SVG;
|
|
} else {
|
|
statusIcon = Constants.OFFLINE_ICON_SVG;
|
|
}
|
|
|
|
return (
|
|
<span
|
|
className={'status ' + this.props.className}
|
|
dangerouslySetInnerHTML={{__html: statusIcon}}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
StatusIcon.defaultProps = {
|
|
className: ''
|
|
};
|
|
|
|
StatusIcon.propTypes = {
|
|
status: React.PropTypes.string,
|
|
className: React.PropTypes.string,
|
|
type: React.PropTypes.string
|
|
};
|