Upgrade ESlint to v8 (#23305)
This commit is contained in:
parent
b58bf74e35
commit
c49213f0ea
120 changed files with 832 additions and 810 deletions
|
@ -57,7 +57,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
|||
|
||||
handleClick = e => {
|
||||
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
|
||||
}
|
||||
};
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (nextProps.active) {
|
||||
|
@ -75,7 +75,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
|||
if (this.node && !this.node.contains(e.target)) {
|
||||
this.props.onClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
attachListeners () {
|
||||
document.addEventListener('click', this.handleDocumentClick, false);
|
||||
|
@ -89,7 +89,7 @@ class ModifierPickerMenu extends React.PureComponent {
|
|||
|
||||
setRef = c => {
|
||||
this.node = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { active } = this.props;
|
||||
|
@ -124,12 +124,12 @@ class ModifierPicker extends React.PureComponent {
|
|||
} else {
|
||||
this.props.onOpen();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleSelect = modifier => {
|
||||
this.props.onChange(modifier);
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { active, modifier } = this.props;
|
||||
|
@ -174,7 +174,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
|||
if (this.node && !this.node.contains(e.target)) {
|
||||
this.props.onClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount () {
|
||||
document.addEventListener('click', this.handleDocumentClick, false);
|
||||
|
@ -198,7 +198,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
|||
|
||||
setRef = c => {
|
||||
this.node = c;
|
||||
}
|
||||
};
|
||||
|
||||
getI18n = () => {
|
||||
const { intl } = this.props;
|
||||
|
@ -219,7 +219,7 @@ class EmojiPickerMenu extends React.PureComponent {
|
|||
custom: intl.formatMessage(messages.custom),
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
handleClick = (emoji, event) => {
|
||||
if (!emoji.native) {
|
||||
|
@ -229,19 +229,19 @@ class EmojiPickerMenu extends React.PureComponent {
|
|||
this.props.onClose();
|
||||
}
|
||||
this.props.onPick(emoji);
|
||||
}
|
||||
};
|
||||
|
||||
handleModifierOpen = () => {
|
||||
this.setState({ modifierOpen: true });
|
||||
}
|
||||
};
|
||||
|
||||
handleModifierClose = () => {
|
||||
this.setState({ modifierOpen: false });
|
||||
}
|
||||
};
|
||||
|
||||
handleModifierChange = modifier => {
|
||||
this.props.onSkinTone(modifier);
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;
|
||||
|
@ -325,7 +325,7 @@ class EmojiPickerDropdown extends React.PureComponent {
|
|||
|
||||
setRef = (c) => {
|
||||
this.dropdown = c;
|
||||
}
|
||||
};
|
||||
|
||||
onShowDropdown = () => {
|
||||
this.setState({ active: true });
|
||||
|
@ -342,11 +342,11 @@ class EmojiPickerDropdown extends React.PureComponent {
|
|||
this.setState({ loading: false, active: false });
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onHideDropdown = () => {
|
||||
this.setState({ active: false });
|
||||
}
|
||||
};
|
||||
|
||||
onToggle = (e) => {
|
||||
if (!this.state.loading && (!e.key || e.key === 'Enter')) {
|
||||
|
@ -356,21 +356,21 @@ class EmojiPickerDropdown extends React.PureComponent {
|
|||
this.onShowDropdown(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyDown = e => {
|
||||
if (e.key === 'Escape') {
|
||||
this.onHideDropdown();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setTargetRef = c => {
|
||||
this.target = c;
|
||||
}
|
||||
};
|
||||
|
||||
findTarget = () => {
|
||||
return this.target;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis, button } = this.props;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue