summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/components/post_message_container.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/components/post_message_container.jsx')
-rw-r--r--webapp/components/post_view/components/post_message_container.jsx106
1 files changed, 0 insertions, 106 deletions
diff --git a/webapp/components/post_view/components/post_message_container.jsx b/webapp/components/post_view/components/post_message_container.jsx
deleted file mode 100644
index 91ca03828..000000000
--- a/webapp/components/post_view/components/post_message_container.jsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import PropTypes from 'prop-types';
-
-// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-
-import ChannelStore from 'stores/channel_store.jsx';
-import EmojiStore from 'stores/emoji_store.jsx';
-import PreferenceStore from 'stores/preference_store.jsx';
-import {Preferences} from 'utils/constants.jsx';
-import TeamStore from 'stores/team_store.jsx';
-import UserStore from 'stores/user_store.jsx';
-
-import PostMessageView from './post_message_view.jsx';
-
-export default class PostMessageContainer extends React.Component {
- static propTypes = {
- post: PropTypes.object.isRequired,
- options: PropTypes.object,
- lastPostCount: PropTypes.number
- };
-
- static defaultProps = {
- options: {}
- };
-
- constructor(props) {
- super(props);
-
- this.onEmojiChange = this.onEmojiChange.bind(this);
- this.onPreferenceChange = this.onPreferenceChange.bind(this);
- this.onUserChange = this.onUserChange.bind(this);
- this.onChannelChange = this.onChannelChange.bind(this);
-
- const mentionKeys = UserStore.getCurrentMentionKeys();
- mentionKeys.push('@here');
-
- this.state = {
- emojis: EmojiStore.getEmojis(),
- enableFormatting: PreferenceStore.getBool(Preferences.CATEGORY_ADVANCED_SETTINGS, 'formatting', true),
- mentionKeys,
- usernameMap: UserStore.getProfilesUsernameMap(),
- channelNamesMap: ChannelStore.getChannelNamesMap(),
- team: TeamStore.getCurrent()
- };
- }
-
- componentDidMount() {
- EmojiStore.addChangeListener(this.onEmojiChange);
- PreferenceStore.addChangeListener(this.onPreferenceChange);
- UserStore.addChangeListener(this.onUserChange);
- ChannelStore.addChangeListener(this.onChannelChange);
- }
-
- componentWillUnmount() {
- EmojiStore.removeChangeListener(this.onEmojiChange);
- PreferenceStore.removeChangeListener(this.onPreferenceChange);
- UserStore.removeChangeListener(this.onUserChange);
- ChannelStore.removeChangeListener(this.onChannelChange);
- }
-
- onEmojiChange() {
- this.setState({
- emojis: EmojiStore.getEmojis()
- });
- }
-
- onPreferenceChange() {
- this.setState({
- enableFormatting: PreferenceStore.getBool(Preferences.CATEGORY_ADVANCED_SETTINGS, 'formatting', true)
- });
- }
-
- onUserChange() {
- const mentionKeys = UserStore.getCurrentMentionKeys();
- mentionKeys.push('@here');
-
- this.setState({
- mentionKeys,
- usernameMap: UserStore.getProfilesUsernameMap()
- });
- }
-
- onChannelChange() {
- this.setState({
- channelNamesMap: ChannelStore.getChannelNamesMap()
- });
- }
-
- render() {
- return (
- <PostMessageView
- options={this.props.options}
- post={this.props.post}
- lastPostCount={this.props.lastPostCount}
- emojis={this.state.emojis}
- enableFormatting={this.state.enableFormatting}
- mentionKeys={this.state.mentionKeys}
- usernameMap={this.state.usernameMap}
- channelNamesMap={this.state.channelNamesMap}
- team={this.state.team}
- />
- );
- }
-}