better names for prop functions

This commit is contained in:
Ben Wheeler committed 2019-10-18 13:40:58 -04:00
1 parent 68780ae6cf
commit b6ff1f40b5
2 files changed
+7 -7

No files matched your search

@@ -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(
+3 -3
View File
@@ -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.