diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:04:13 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:11:58 -0700 |
commit | d8bd57901e33a7057e26e782e295099ffcc0da89 (patch) | |
tree | e12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/components/post_view/new_message_indicator.jsx | |
parent | 7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff) | |
download | chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2 chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip |
Removing webapp
Diffstat (limited to 'webapp/components/post_view/new_message_indicator.jsx')
-rw-r--r-- | webapp/components/post_view/new_message_indicator.jsx | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/webapp/components/post_view/new_message_indicator.jsx b/webapp/components/post_view/new_message_indicator.jsx deleted file mode 100644 index 537520c29..000000000 --- a/webapp/components/post_view/new_message_indicator.jsx +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; -import PropTypes from 'prop-types'; -import Constants from 'utils/constants.jsx'; -import {FormattedMessage} from 'react-intl'; - -export default class NewMessageIndicator extends React.PureComponent { - static propTypes = { - onClick: PropTypes.func.isRequired, - newMessages: PropTypes.number - } - - constructor(props) { - super(props); - this.state = { - visible: false, - rendered: false - }; - } - - componentWillReceiveProps(nextProps) { - if (nextProps.newMessages > 0) { - this.setState({rendered: true}, () => { - this.setState({visible: true}); - }); - } else { - this.setState({visible: false}); - } - } - - render() { - const unreadIcon = Constants.UNREAD_ICON_SVG; - let className = 'new-messages__button'; - if (this.state.visible > 0) { - className += ' visible'; - } - if (!this.state.rendered) { - className += ' disabled'; - } - return ( - <div - className={className} - onTransitionEnd={this.setRendered.bind(this)} - ref='indicator' - > - <div onClick={this.props.onClick}> - <FormattedMessage - id='posts_view.newMsgBelow' - defaultMessage='New {count, plural, one {message} other {messages}}' - values={{count: this.props.newMessages}} - /> - <span - className='icon icon__unread' - dangerouslySetInnerHTML={{__html: unreadIcon}} - /> - </div> - </div> - ); - } - - // Sync 'rendered' state with visibility param, only after transitions - // have ended - setRendered() { - this.setState({rendered: this.state.visible}); - } -} - -NewMessageIndicator.defaultProps = { - newMessages: 0 -}; |