@@ -21,11 +21,11 @@ const messages = defineMessages({
21
21
const TitledHOC = function ( WrappedComponent ) {
22
22
class TitledComponent extends React . Component {
23
23
componentDidMount ( ) {
24
- this . updateReduxProjectTitleWithDefault ( this . props . projectTitle ) ;
24
+ this . handleReceivedProjectTitle ( this . props . projectTitle ) ;
25
25
}
26
26
componentDidUpdate ( prevProps ) {
27
27
if ( this . props . projectTitle !== prevProps . projectTitle ) {
28
- this . updateReduxProjectTitleWithDefault ( this . props . projectTitle ) ;
28
+ this . handleReceivedProjectTitle ( this . props . projectTitle ) ;
29
29
}
30
30
// if the projectTitle hasn't changed, but the reduxProjectTitle
31
31
// HAS changed, we need to report that change to the projectTitle's owner
@@ -34,25 +34,25 @@ const TitledHOC = function (WrappedComponent) {
34
34
this . props . onUpdateProjectTitle ( this . props . reduxProjectTitle ) ;
35
35
}
36
36
}
37
- updateReduxProjectTitleWithDefault ( requestedTitle ) {
37
+ handleReceivedProjectTitle ( requestedTitle ) {
38
38
let newTitle = requestedTitle ;
39
39
if ( newTitle === null || typeof newTitle === 'undefined' ) {
40
40
newTitle = this . props . intl . formatMessage ( messages . defaultProjectTitle ) ;
41
41
}
42
- this . props . updateReduxProjectTitle ( newTitle ) ;
42
+ this . props . onChangedProjectTitle ( newTitle ) ;
43
43
}
44
44
render ( ) {
45
45
const {
46
46
/* eslint-disable no-unused-vars */
47
47
intl,
48
48
isShowingWithoutId,
49
+ onChangedProjectTitle,
49
50
// for children, we replace onUpdateProjectTitle with our own
50
51
onUpdateProjectTitle,
51
52
// we don't pass projectTitle prop to children -- they must use
52
53
// redux value
53
54
projectTitle,
54
55
reduxProjectTitle,
55
- updateReduxProjectTitle,
56
56
/* eslint-enable no-unused-vars */
57
57
...componentProps
58
58
} = this . props ;
@@ -67,10 +67,10 @@ const TitledHOC = function (WrappedComponent) {
67
67
TitledComponent . propTypes = {
68
68
intl : intlShape ,
69
69
isShowingWithoutId : PropTypes . bool ,
70
+ onChangedProjectTitle : PropTypes . func ,
70
71
onUpdateProjectTitle : PropTypes . func ,
71
72
projectTitle : PropTypes . string ,
72
- reduxProjectTitle : PropTypes . string ,
73
- updateReduxProjectTitle : PropTypes . func
73
+ reduxProjectTitle : PropTypes . string
74
74
} ;
75
75
76
76
TitledComponent . defaultProps = {
@@ -86,7 +86,7 @@ const TitledHOC = function (WrappedComponent) {
86
86
} ;
87
87
88
88
const mapDispatchToProps = dispatch => ( {
89
- updateReduxProjectTitle : title => dispatch ( setProjectTitle ( title ) )
89
+ onChangedProjectTitle : title => dispatch ( setProjectTitle ( title ) )
90
90
} ) ;
91
91
92
92
return injectIntl ( connect (
0 commit comments