// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as Utils from 'utils/utils.jsx';
import {FormattedMessage} from 'react-intl';
import {Modal} from 'react-bootstrap';
import React from 'react';
export default class ChannelInfoModal extends React.Component {
shouldComponentUpdate(nextProps) {
if (nextProps.show !== this.props.show) {
return true;
}
if (!Utils.areObjectsEqual(nextProps.channel, this.props.channel)) {
return true;
}
return false;
}
render() {
let channel = this.props.channel;
let channelIcon;
if (!channel) {
const notFound = Utils.localizeMessage('channel_info.notFound', 'No Channel Found');
channel = {
display_name: notFound,
name: notFound,
purpose: notFound,
id: notFound
};
}
if (channel.type === 'O') {
channelIcon = ();
} else if (channel.type === 'P') {
channelIcon = ();
}
const channelURL = Utils.getTeamURLFromAddressBar() + '/channels/' + channel.name;
return (
{channelIcon}{channel.display_name}
);
}
}
ChannelInfoModal.propTypes = {
show: React.PropTypes.bool.isRequired,
onHide: React.PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired
};