refactoring

This commit is contained in:
Philipp Kühn
2021-03-16 22:22:13 +01:00
parent a76de1ab6d
commit 49fcf829f3
9 changed files with 91 additions and 55 deletions

View File

@@ -13,7 +13,7 @@ export class MentionList extends React.Component {
componentDidUpdate(oldProps) {
if (this.props.items !== oldProps.items) {
this.setState({
selectedIndex: 0
selectedIndex: 0,
})
}
}
@@ -39,13 +39,13 @@ export class MentionList extends React.Component {
upHandler() {
this.setState({
selectedIndex: ((this.state.selectedIndex + this.props.items.length) - 1) % this.props.items.length
selectedIndex: ((this.state.selectedIndex + this.props.items.length) - 1) % this.props.items.length,
})
}
downHandler() {
this.setState({
selectedIndex: (this.state.selectedIndex + 1) % this.props.items.length
selectedIndex: (this.state.selectedIndex + 1) % this.props.items.length,
})
}

View File

@@ -66,9 +66,9 @@ export default () => {
reactRenderer.destroy()
},
}
}
},
},
})
}),
],
content: `
<p>
@@ -84,8 +84,8 @@ export default () => {
return (
<div>
<EditorContent editor={editor} />
{editor &&
<div className={`character-count ${editor.getCharacterCount() === limit ? 'character-count--warning' : ''}`}>
{editor
&& <div className={`character-count ${editor.getCharacterCount() === limit ? 'character-count--warning' : ''}`}>
<svg
height="20"
width="20"