From f578bb1e48ec4d97bca92c7faf0dd8ed5aeceb39 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Tue, 1 Sep 2015 17:06:31 -0700 Subject: MM-2065 style refactoring --- web/react/components/channel_info_modal.jsx | 97 +++++++---- web/react/components/channel_invite_modal.jsx | 38 ++++- web/react/components/command_list.jsx | 97 +++++++---- web/react/components/file_upload.jsx | 102 ++++++----- web/react/components/find_team.jsx | 64 ++++--- web/react/components/invite_member_modal.jsx | 188 +++++++++++++++------ web/react/components/member_list.jsx | 33 ++-- web/react/components/more_direct_channels.jsx | 60 +++++-- web/react/components/msg_typing.jsx | 85 ++++++---- web/react/components/post_list.jsx | 25 ++- .../components/removed_from_channel_modal.jsx | 129 +++++++++----- web/react/components/rhs_thread.jsx | 17 +- web/react/components/setting_picture.jsx | 84 +++++++-- web/react/components/setting_upload.jsx | 64 ++++--- web/react/components/sidebar_right_menu.jsx | 76 +++++++-- web/react/components/team_import_tab.jsx | 83 ++++++--- web/react/components/team_members.jsx | 140 ++++++++++----- web/react/components/user_settings.jsx | 76 ++++++--- 18 files changed, 1001 insertions(+), 457 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/channel_info_modal.jsx b/web/react/components/channel_info_modal.jsx index 6d999870a..b658dbe6e 100644 --- a/web/react/components/channel_info_modal.jsx +++ b/web/react/components/channel_info_modal.jsx @@ -3,57 +3,86 @@ var ChannelStore = require('../stores/channel_store.jsx'); -module.exports = React.createClass({ - componentDidMount: function() { +export default class CommandList extends React.Component { + constructor(props) { + super(props); + + this.state = { + channel_id: ChannelStore.getCurrentId() + }; + } + + componentDidMount() { var self = this; - if(this.refs.modal) { - $(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) { - var button = e.relatedTarget; - self.setState({ channel_id: $(button).attr('data-channelid') }); - }); + if (this.refs.modal) { + $(this.refs.modal.getDOMNode()).on('show.bs.modal', function show(e) { + var button = e.relatedTarget; + self.setState({channel_id: $(button).attr('data-channelid')}); + }); } - }, - getInitialState: function() { - return { channel_id: ChannelStore.getCurrentId() }; - }, - render: function() { + } + + render() { var channel = ChannelStore.get(this.state.channel_id); if (!channel) { channel = {}; - channel.display_name = "No Channel Found"; - channel.name = "No Channel Found"; - channel.id = "No Channel Found"; + channel.display_name = 'No Channel Found'; + channel.name = 'No Channel Found'; + channel.id = 'No Channel Found'; } return ( -