// 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 * as TextFormatting from 'utils/text_formatting.jsx'; 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, header: notFound, id: notFound }; } if (channel.type === 'O') { channelIcon = (); } else if (channel.type === 'P') { channelIcon = (); } const channelURL = Utils.getTeamURLFromAddressBar() + '/channels/' + channel.name; let channelPurpose = null; if (channel.purpose) { channelPurpose = (