From d2edd3aaee705e27d8a21723210c69ba603ab904 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 1 Mar 2017 23:59:24 -0500 Subject: [PATCH] Add shouldComponentUpdate to sprite-info for perf --- src/components/sprite-info/sprite-info.jsx | 282 +++++++++++---------- 1 file changed, 147 insertions(+), 135 deletions(-) diff --git a/src/components/sprite-info/sprite-info.jsx b/src/components/sprite-info/sprite-info.jsx index 6244cfe02..2dcf84354 100644 --- a/src/components/sprite-info/sprite-info.jsx +++ b/src/components/sprite-info/sprite-info.jsx @@ -13,149 +13,161 @@ const notDraggableIcon = require('./icon--not-draggable.svg'); const ROTATION_STYLES = ['left-right', 'don\'t rotate', 'all around']; -const SpriteInfo = props => { - const nameDisabled = typeof props.name === 'undefined'; - const xDisabled = typeof props.x === 'undefined'; - const yDisabled = typeof props.y === 'undefined'; - const visibleDisabled = typeof props.visible === 'undefined'; - const draggableDisabled = typeof props.draggable === 'undefined'; - const rotationStyleDisabled = typeof props.rotationStyle === 'undefined'; - return ( - -
-
- Sprite - -
- -
- - x - -
- -
- - y - -
-
- - -
-
- - Show - -
- +
+
+ Sprite + +
+ +
+ x + +
+ +
+ + y +
-
- - Draggable - -
- - + +
+
+ + Show + +
+ + +
+
+ +
+ + Draggable + +
+ + +
+
+ +
+ + Rotation + +
- -
- - Rotation - - -
-
- - ); -}; + + ); + } +} SpriteInfo.propTypes = { draggable: React.PropTypes.bool,