// 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; if (!channel) { const notFound = Utils.localizeMessage('channel_info.notFound', 'No Channel Found'); channel = { display_name: notFound, name: notFound, purpose: notFound, id: notFound }; } const channelURL = Utils.getTeamURLFromAddressBar() + '/channels/' + channel.name; return ( {channel.display_name}
{channel.display_name}
{channelURL}
{channel.id}
{channel.purpose}
); } } ChannelInfoModal.propTypes = { show: React.PropTypes.bool.isRequired, onHide: React.PropTypes.func.isRequired, channel: React.PropTypes.object.isRequired };