diff --git a/src/renderer/components/heading.js b/src/renderer/components/heading.js index 2a68fb91..43e78de0 100644 --- a/src/renderer/components/heading.js +++ b/src/renderer/components/heading.js @@ -1,11 +1,12 @@ const React = require('react') +const PropTypes = require('prop-types') const colors = require('material-ui/styles/colors') class Heading extends React.Component { static get propTypes () { return { - level: React.PropTypes.number + level: PropTypes.number } } diff --git a/src/renderer/components/path-selector.js b/src/renderer/components/path-selector.js index ca377c65..6ad66d4b 100644 --- a/src/renderer/components/path-selector.js +++ b/src/renderer/components/path-selector.js @@ -1,6 +1,7 @@ const colors = require('material-ui/styles/colors') const electron = require('electron') const React = require('react') +const PropTypes = require('prop-types') const remote = electron.remote @@ -11,15 +12,15 @@ const TextField = require('material-ui/TextField').default // Uses the system Open File dialog. // You can't edit the text field directly. class PathSelector extends React.Component { - static get propTypes () { + static propTypes () { return { - className: React.PropTypes.string, - dialog: React.PropTypes.object, - displayValue: React.PropTypes.string, - id: React.PropTypes.string, - onChange: React.PropTypes.func, - title: React.PropTypes.string.isRequired, - value: React.PropTypes.string + className: PropTypes.string, + dialog: PropTypes.object, + displayValue: PropTypes.string, + id: PropTypes.string, + onChange: PropTypes.func, + title: PropTypes.string.isRequired, + value: PropTypes.string } } @@ -64,7 +65,8 @@ class PathSelector extends React.Component { const textFieldStyle = { flex: '1' } - const text = this.props.displayValue || this.props.value + + const text = this.props.displayValue || this.props.value || '' const buttonStyle = { marginLeft: 10 } diff --git a/src/renderer/components/show-more.js b/src/renderer/components/show-more.js index bb0084e1..1ddb44d4 100644 --- a/src/renderer/components/show-more.js +++ b/src/renderer/components/show-more.js @@ -1,13 +1,14 @@ const React = require('react') +const PropTypes = require('prop-types') const RaisedButton = require('material-ui/RaisedButton').default class ShowMore extends React.Component { static get propTypes () { return { - defaultExpanded: React.PropTypes.bool, - hideLabel: React.PropTypes.string, - showLabel: React.PropTypes.string + defaultExpanded: PropTypes.bool, + hideLabel: PropTypes.string, + showLabel: PropTypes.string } } diff --git a/src/renderer/pages/preferences-page.js b/src/renderer/pages/preferences-page.js index 3dd32adf..687af900 100644 --- a/src/renderer/pages/preferences-page.js +++ b/src/renderer/pages/preferences-page.js @@ -1,5 +1,6 @@ const path = require('path') const React = require('react') +const PropTypes = require('prop-types') const colors = require('material-ui/styles/colors') const Checkbox = require('material-ui/Checkbox').default @@ -238,7 +239,7 @@ class PreferencesPage extends React.Component { class PreferencesSection extends React.Component { static get propTypes () { return { - title: React.PropTypes.string + title: PropTypes.string } }