Skip to content

Commit 2a0aad6

Browse files
Merge pull request #622 from creative-commoners/pulls/6.1/defaultprops
ENH Use javascript default parameters instead of defaultProps
2 parents 47ac6bb + b41ccd3 commit 2a0aad6

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

client/dist/js/bundle-cms.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/dist/js/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/Register/Complete.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import Title from './Title';
77
* This component provides a registration confirmation screen to be shown once a member has
88
* completed all steps that are part of the MFA registration process
99
*/
10-
const Complete = ({ onComplete, showTitle, message }) => (
10+
const Complete = ({
11+
onComplete,
12+
showTitle = true,
13+
message
14+
}) => (
1115
<div className="mfa-register-confirmation">
1216
<i className="font-icon-check-mark mfa-register-confirmation__icon" />
1317
{ showTitle && <Title className="mfa-register-confirmation__title" /> }
@@ -31,8 +35,4 @@ Complete.propTypes = {
3135
showTitle: PropTypes.bool,
3236
};
3337

34-
Complete.defaultProps = {
35-
showTitle: true,
36-
};
37-
3838
export default Complete;

client/src/components/Register/Introduction.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ export const ActionList = ({ canSkip, onContinue, onSkip }) => {
3333
);
3434
};
3535

36-
const Introduction = ({ canSkip, onContinue, onSkip, resources, showTitle, TitleComponent }) => {
36+
const Introduction = ({
37+
canSkip,
38+
onContinue,
39+
onSkip,
40+
resources,
41+
showTitle = true,
42+
TitleComponent = Title
43+
}) => {
3744
const { ss: { i18n } } = window;
3845

3946
return (
@@ -131,11 +138,6 @@ Introduction.propTypes = {
131138
TitleComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
132139
};
133140

134-
Introduction.defaultProps = {
135-
showTitle: true,
136-
TitleComponent: Title
137-
};
138-
139141
export { Introduction as Component };
140142

141143
const mapDispatchToProps = dispatch => ({

0 commit comments

Comments
 (0)