From c1117a8ce527dbc3479a4c5518e55581e471bef8 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Sun, 12 Nov 2017 19:12:32 +0100 Subject: [PATCH] move static outside class --- src/interface/index.js | 54 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/interface/index.js b/src/interface/index.js index 8614cb1..2aaa251 100644 --- a/src/interface/index.js +++ b/src/interface/index.js @@ -54,33 +54,6 @@ const styles = { }; class Interface extends React.Component { - static defaultProps = { - width: 720, - height: 480, - printers: printerSettings, - defaultPrinter: 'ultimaker2', - quality: qualitySettings, - defaultQuality: 'medium', - materials: materialSettings, - defaultMaterial: 'pla', - }; - static propTypes = { - geometry: (props, propName) => { - if (!(props[propName].isGeometry || props[propName].isBufferGeometry)) { - throw new Error('invalid prop, is not geometry'); - } - }, - width: PropTypes.number.isRequired, - height: PropTypes.number.isRequired, - classes: PropTypes.objectOf(PropTypes.string), - printers: PropTypes.object.isRequired, - defaultPrinter: PropTypes.string.isRequired, - quality: PropTypes.object.isRequired, - defaultQuality: PropTypes.string.isRequired, - materials: PropTypes.object.isRequired, - defaultMaterial: PropTypes.string.isRequired, - onCompleteActions: PropTypes.arrayOf(PropTypes.shape({ title: PropTypes.string, callback: PropTypes.func })).isRequired, - }; constructor(props) { super(props); this.state = { @@ -248,5 +221,32 @@ class Interface extends React.Component { ); } } +Interface.defaultProps = { + width: 720, + height: 480, + printers: printerSettings, + defaultPrinter: 'ultimaker2', + quality: qualitySettings, + defaultQuality: 'medium', + materials: materialSettings, + defaultMaterial: 'pla', +}; +Interface.propTypes = { + geometry(props, propName) { + if (!(props[propName].isGeometry || props[propName].isBufferGeometry)) { + throw new Error('invalid prop, is not geometry'); + } + }, + width: PropTypes.number.isRequired, + height: PropTypes.number.isRequired, + classes: PropTypes.objectOf(PropTypes.string), + printers: PropTypes.object.isRequired, + defaultPrinter: PropTypes.string.isRequired, + quality: PropTypes.object.isRequired, + defaultQuality: PropTypes.string.isRequired, + materials: PropTypes.object.isRequired, + defaultMaterial: PropTypes.string.isRequired, + onCompleteActions: PropTypes.arrayOf(PropTypes.shape({ title: PropTypes.string, callback: PropTypes.func })).isRequired, +}; export default injectSheet(styles)(Interface);