Fix some react natives warning messages (#4653)

Этот коммит содержится в:
enahum
2016-11-28 12:38:33 -03:00
коммит произвёл Harrison Healey
родитель 8d9768dad3
Коммит 7315d69474
9 изменённых файлов: 38 добавлений и 29 удалений

Просмотреть файл

@@ -53,11 +53,17 @@ export default class AutosizeTextarea extends React.Component {
}
render() {
const props = {...this.props};
Reflect.deleteProperty(props, 'onHeightChange');
Reflect.deleteProperty(props, 'providers');
Reflect.deleteProperty(props, 'channelId');
const {
value,
placeholder,
...otherProps
} = this.props;
} = props;
const heightProps = {};
if (this.height <= 0) {
@@ -72,7 +78,7 @@ export default class AutosizeTextarea extends React.Component {
<textarea
ref='textarea'
{...heightProps}
{...this.props}
{...props}
/>
<div style={{height: 0, overflow: 'hidden'}}>
<textarea
@@ -86,4 +92,4 @@ export default class AutosizeTextarea extends React.Component {
</div>
);
}
}
}

Просмотреть файл

@@ -227,6 +227,6 @@ ChangeUrlModal.propTypes = {
currentURL: React.PropTypes.string,
serverError: React.PropTypes.node,
onModalSubmit: React.PropTypes.func.isRequired,
onModalExited: React.PropTypes.func.optional,
onModalExited: React.PropTypes.func,
onModalDismissed: React.PropTypes.func.isRequired
};

Просмотреть файл

@@ -448,7 +448,10 @@ export default class ChannelHeader extends React.Component {
);
dropdownContents.push(
<li className='divider'/>
<li
key='divider-1'
className='divider'
/>
);
if (!ChannelStore.isDefault(channel)) {
@@ -511,7 +514,10 @@ export default class ChannelHeader extends React.Component {
}
dropdownContents.push(
<li className='divider'/>
<li
key='divider-2'
className='divider'
/>
);
const deleteOption = (
@@ -607,7 +613,10 @@ export default class ChannelHeader extends React.Component {
}
dropdownContents.push(
<li className='divider'/>
<li
key='divider-3'
className='divider'
/>
);
const canLeave = channel.type === Constants.PRIVATE_CHANNEL ? this.state.userCount > 1 : true;

Просмотреть файл

@@ -12,20 +12,13 @@ import UserStore from 'stores/user_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'react-intl';
import {FormattedMessage} from 'react-intl';
import {Modal} from 'react-bootstrap';
const holders = defineMessages({
nameEx: {
id: 'channel_modal.nameEx',
defaultMessage: 'E.g.: "Bugs", "Marketing", "客户支持"'
}
});
import React from 'react';
class NewChannelModal extends React.Component {
export default class NewChannelModal extends React.Component {
constructor(props) {
super(props);
@@ -242,7 +235,7 @@ class NewChannelModal extends React.Component {
type='text'
ref='display_name'
className='form-control'
placeholder={this.props.intl.formatMessage(holders.nameEx)}
placeholder={Utils.localizeMessage('channel_modal.nameEx', 'E.g.: "Bugs", "Marketing", "客户支持"')}
maxLength='22'
value={this.props.channelData.displayName}
autoFocus={true}
@@ -284,7 +277,7 @@ class NewChannelModal extends React.Component {
className='form-control no-resize'
ref='channel_purpose'
rows='4'
placeholder={this.props.intl.formatMessage({id: 'channel_modal.purpose'})}
placeholder={Utils.localizeMessage('channel_modal.purpose', 'Purpose')}
maxLength='250'
value={this.props.channelData.purpose}
onChange={this.handleChange}
@@ -321,7 +314,7 @@ class NewChannelModal extends React.Component {
className='form-control no-resize'
ref='channel_header'
rows='4'
placeholder={this.props.intl.formatMessage({id: 'channel_modal.header'})}
placeholder={Utils.localizeMessage('channel_modal.header', 'Header')}
maxLength='128'
value={this.props.channelData.header}
onChange={this.handleChange}
@@ -377,17 +370,15 @@ NewChannelModal.defaultProps = {
serverError: null
};
NewChannelModal.propTypes = {
intl: intlShape.isRequired,
show: React.PropTypes.bool.isRequired,
channelType: React.PropTypes.string.isRequired,
channelData: React.PropTypes.object.isRequired,
serverError: React.PropTypes.node,
onSubmitChannel: React.PropTypes.func.isRequired,
onModalDismissed: React.PropTypes.func.isRequired,
onModalExited: React.PropTypes.func.optional,
onModalExited: React.PropTypes.func,
onTypeSwitched: React.PropTypes.func.isRequired,
onChangeURLPressed: React.PropTypes.func.isRequired,
onDataChanged: React.PropTypes.func.isRequired
};
export default injectIntl(NewChannelModal);

Просмотреть файл

@@ -211,7 +211,7 @@ export default class PostBody extends React.Component {
PostBody.propTypes = {
post: React.PropTypes.object.isRequired,
parentPost: React.PropTypes.object,
retryPost: React.PropTypes.func.isRequired,
retryPost: React.PropTypes.func,
handleCommentClick: React.PropTypes.func.isRequired,
compactDisplay: React.PropTypes.bool,
previewCollapsed: React.PropTypes.string,

Просмотреть файл

@@ -456,7 +456,8 @@ export default class SidebarHeaderDropdown extends React.Component {
return (
<Dropdown
open={this.state.showDropdown}
id='sidebar-header-dropdown'
defaultOpen={this.state.showDropdown}
onClose={this.toggleDropdown}
className='sidebar-header-dropdown'
pullRight={true}

Просмотреть файл

@@ -33,5 +33,5 @@ export default class StatusIcon extends React.Component {
}
StatusIcon.propTypes = {
status: React.PropTypes.string.isRequired
};
status: React.PropTypes.string
};

Просмотреть файл

@@ -180,11 +180,13 @@ export default class SuggestionBox extends React.Component {
/>
);
} else if (type === 'search') {
const newProps = {...props};
Reflect.deleteProperty(newProps, 'providers');
textbox = (
<input
ref='textbox'
type='search'
{...props}
{...newProps}
onInput={this.handleChange}
onKeyDown={this.handleKeyDown}
/>

Просмотреть файл

@@ -96,7 +96,6 @@ class UserSettingsGeneralTab extends React.Component {
this.updateSection = this.updateSection.bind(this);
this.state = this.setupInitialState(props);
this.setState({maxFileSize: global.window.mm_config.MaxFileSize});
}
submitUsername(e) {
@@ -307,7 +306,8 @@ class UserSettingsGeneralTab extends React.Component {
confirmEmail: '',
picture: null,
loadingPicture: false,
emailChangeInProgress: false
emailChangeInProgress: false,
maxFileSize: global.window.mm_config.MaxFileSize
};
}