From 42f50049ff29ccdc484c22f8a5a19cda2dd03a5b Mon Sep 17 00:00:00 2001 From: kibigo! Date: Wed, 3 Jan 2018 12:36:21 -0800 Subject: WIP Refactor; 1000 tiny edits --- .../features/composer/upload_form/item/index.js | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'app/javascript/flavours/glitch/features/composer/upload_form/item') diff --git a/app/javascript/flavours/glitch/features/composer/upload_form/item/index.js b/app/javascript/flavours/glitch/features/composer/upload_form/item/index.js index cbec5ecd9..ec67b8ef8 100644 --- a/app/javascript/flavours/glitch/features/composer/upload_form/item/index.js +++ b/app/javascript/flavours/glitch/features/composer/upload_form/item/index.js @@ -31,7 +31,7 @@ const messages = defineMessages({ const handlers = { // On blur, we save the description for the media item. - blur () { + handleBlur () { const { id, onChangeDescription, @@ -48,27 +48,27 @@ const handlers = { // When the value of our description changes, we store it in the // temp value `dirtyDescription` in our state. - change ({ target: { value } }) { + handleChange ({ target: { value } }) { this.setState({ dirtyDescription: value }); }, // Records focus on the media item. - focus () { + handleFocus () { this.setState({ focused: true }); }, // Records the start of a hover over the media item. - mouseEnter () { + handleMouseEnter () { this.setState({ hovered: true }); }, // Records the end of a hover over the media item. - mouseLeave () { + handleMouseLeave () { this.setState({ hovered: false }); }, // Removes the media item. - remove () { + handleRemove () { const { id, onRemove, @@ -85,7 +85,7 @@ export default class ComposerUploadFormItem extends React.PureComponent { // Constructor. constructor (props) { super(props); - assignHandlers(handlers); + assignHandlers(this, handlers); this.state = { hovered: false, focused: false, @@ -96,12 +96,12 @@ export default class ComposerUploadFormItem extends React.PureComponent { // Rendering. render () { const { - blur, - change, - focus, - mouseEnter, - mouseLeave, - remove, + handleBlur, + handleChange, + handleFocus, + handleMouseEnter, + handleMouseLeave, + handleRemove, } = this.handlers; const { description, @@ -119,8 +119,8 @@ export default class ComposerUploadFormItem extends React.PureComponent { return (
@@ -149,9 +149,9 @@ export default class ComposerUploadFormItem extends React.PureComponent {