From b6ff1f40b526354dd7f70b8a0e92c057d0846bab Mon Sep 17 00:00:00 2001 From: Ben Wheeler <wheeler.benjamin@gmail.com> Date: Fri, 18 Oct 2019 13:40:58 -0400 Subject: [PATCH] better names for prop functions --- src/components/menu-bar/project-title-input.jsx | 8 ++++---- src/containers/sb-file-uploader.jsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/menu-bar/project-title-input.jsx b/src/components/menu-bar/project-title-input.jsx index 4f90914a3..fe7647cb0 100644 --- a/src/components/menu-bar/project-title-input.jsx +++ b/src/components/menu-bar/project-title-input.jsx @@ -21,8 +21,8 @@ const messages = defineMessages({ const ProjectTitleInput = ({ className, - handleUpdateReduxProjectTitle, intl, + onSubmit, projectTitle }) => ( <BufferedInput @@ -32,14 +32,14 @@ const ProjectTitleInput = ({ tabIndex="0" type="text" value={projectTitle} - onSubmit={handleUpdateReduxProjectTitle} + onSubmit={onSubmit} /> ); ProjectTitleInput.propTypes = { className: PropTypes.string, - handleUpdateReduxProjectTitle: PropTypes.func, intl: intlShape.isRequired, + onSubmit: PropTypes.func, projectTitle: PropTypes.string }; @@ -48,7 +48,7 @@ const mapStateToProps = state => ({ }); const mapDispatchToProps = dispatch => ({ - handleUpdateReduxProjectTitle: title => dispatch(setProjectTitle(title)) + onSubmit: title => dispatch(setProjectTitle(title)) }); export default injectIntl(connect( diff --git a/src/containers/sb-file-uploader.jsx b/src/containers/sb-file-uploader.jsx index c4f484c22..2019f719e 100644 --- a/src/containers/sb-file-uploader.jsx +++ b/src/containers/sb-file-uploader.jsx @@ -132,7 +132,7 @@ class SBFileUploader extends React.Component { // This is necessary in case the user wants to reload a project if (filename) { const uploadedProjectTitle = this.getProjectTitleFromFilename(filename); - this.props.updateReduxProjectTitle(uploadedProjectTitle); + this.props.onReceivedProjectTitle(uploadedProjectTitle); } this.resetFileInput(); }) @@ -182,7 +182,7 @@ SBFileUploader.propTypes = { onLoadingStarted: PropTypes.func, projectChanged: PropTypes.bool, requestProjectUpload: PropTypes.func, - updateReduxProjectTitle: PropTypes.func, + onReceivedProjectTitle: PropTypes.func, userOwnsProject: PropTypes.bool, vm: PropTypes.shape({ loadProject: PropTypes.func @@ -211,7 +211,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ }, requestProjectUpload: loadingState => dispatch(requestProjectUpload(loadingState)), onLoadingStarted: () => dispatch(openLoadingProject()), - updateReduxProjectTitle: title => dispatch(setProjectTitle(title)) + onReceivedProjectTitle: title => dispatch(setProjectTitle(title)) }); // Allow incoming props to override redux-provided props. Used to mock in tests. -- GitLab