Fix lint warnings
This commit is contained in:
1 parent
a23953a758
commit
2060cb0b38
6 files changed
+117
-117
No files matched your search
@@ -1,30 +1,28 @@
|
||||
const React = require('react');
|
||||
const greenFlagIcon = require('./green-flag.svg');
|
||||
|
||||
class GreenFlagComponent extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
onClick,
|
||||
title,
|
||||
...props
|
||||
} = this.props;
|
||||
return (
|
||||
<img
|
||||
className="scratch-green-flag"
|
||||
src={greenFlagIcon}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 440,
|
||||
width: 50
|
||||
}}
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
const GreenFlagComponent = function (props) {
|
||||
const {
|
||||
onClick,
|
||||
title,
|
||||
...componentProps
|
||||
} = props;
|
||||
return (
|
||||
<img
|
||||
className="scratch-green-flag"
|
||||
src={greenFlagIcon}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 440,
|
||||
width: 50
|
||||
}}
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
{...componentProps}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
GreenFlagComponent.propTypes = {
|
||||
onClick: React.PropTypes.func,
|
||||
|
||||
+21
-23
@@ -1,28 +1,26 @@
|
||||
const React = require('react');
|
||||
|
||||
class GUIComponent extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
children,
|
||||
...props
|
||||
} = this.props;
|
||||
return (
|
||||
<div
|
||||
className="scratch-gui"
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const GUIComponent = function (props) {
|
||||
const {
|
||||
children,
|
||||
...componentProps
|
||||
} = props;
|
||||
return (
|
||||
<div
|
||||
className="scratch-gui"
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
}}
|
||||
{...componentProps}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
GUIComponent.propTypes = {
|
||||
children: React.PropTypes.node
|
||||
|
||||
@@ -1,48 +1,46 @@
|
||||
const React = require('react');
|
||||
|
||||
class SpriteSelectorComponent extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
onChange,
|
||||
sprites,
|
||||
value,
|
||||
openNewSprite,
|
||||
openNewCostume,
|
||||
openNewBackdrop,
|
||||
...props
|
||||
} = this.props;
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 10
|
||||
}}
|
||||
{...props}
|
||||
const SpriteSelectorComponent = function (props) {
|
||||
const {
|
||||
onChange,
|
||||
sprites,
|
||||
value,
|
||||
openNewSprite,
|
||||
openNewCostume,
|
||||
openNewBackdrop,
|
||||
...componentProps
|
||||
} = props;
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 10
|
||||
}}
|
||||
{...componentProps}
|
||||
>
|
||||
<select
|
||||
multiple
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
>
|
||||
<select
|
||||
multiple
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
>
|
||||
{sprites.map(sprite => (
|
||||
<option
|
||||
key={sprite.id}
|
||||
value={sprite.id}
|
||||
>
|
||||
{sprite.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<p>
|
||||
<button onClick={openNewSprite}>New sprite</button>
|
||||
<button onClick={openNewCostume}>New costume</button>
|
||||
<button onClick={openNewBackdrop}>New backdrop</button>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
{sprites.map(sprite => (
|
||||
<option
|
||||
key={sprite.id}
|
||||
value={sprite.id}
|
||||
>
|
||||
{sprite.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<p>
|
||||
<button onClick={openNewSprite}>New sprite</button>
|
||||
<button onClick={openNewCostume}>New costume</button>
|
||||
<button onClick={openNewBackdrop}>New backdrop</button>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
SpriteSelectorComponent.propTypes = {
|
||||
onChange: React.PropTypes.func,
|
||||
|
||||
@@ -1,30 +1,28 @@
|
||||
const React = require('react');
|
||||
const stopAllIcon = require('./stop-all.svg');
|
||||
|
||||
class StopAllComponent extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
onClick,
|
||||
title,
|
||||
...props
|
||||
} = this.props;
|
||||
return (
|
||||
<img
|
||||
className="scratch-stop-all"
|
||||
src={stopAllIcon}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 380,
|
||||
width: 50
|
||||
}}
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
const StopAllComponent = function (props) {
|
||||
const {
|
||||
onClick,
|
||||
title,
|
||||
...componentProps
|
||||
} = props;
|
||||
return (
|
||||
<img
|
||||
className="scratch-stop-all"
|
||||
src={stopAllIcon}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 380,
|
||||
right: 380,
|
||||
width: 50
|
||||
}}
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
{...componentProps}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
StopAllComponent.propTypes = {
|
||||
onClick: React.PropTypes.func,
|
||||
|
||||
@@ -17,7 +17,8 @@ class Blocks extends React.Component {
|
||||
'onBlockGlowOn',
|
||||
'onBlockGlowOff',
|
||||
'onVisualReport',
|
||||
'onWorkspaceUpdate'
|
||||
'onWorkspaceUpdate',
|
||||
'setBlocks'
|
||||
]);
|
||||
}
|
||||
componentDidMount () {
|
||||
@@ -72,6 +73,9 @@ class Blocks extends React.Component {
|
||||
ScratchBlocks.Xml.domToWorkspace(dom, this.workspace);
|
||||
ScratchBlocks.Events.enable();
|
||||
}
|
||||
setBlocks (blocks) {
|
||||
this.blocks = blocks;
|
||||
}
|
||||
render () {
|
||||
const {
|
||||
options, // eslint-disable-line no-unused-vars
|
||||
@@ -80,7 +84,7 @@ class Blocks extends React.Component {
|
||||
} = this.props;
|
||||
return (
|
||||
<BlocksComponent
|
||||
componentRef={c => (this.blocks = c)}
|
||||
componentRef={this.setBlocks}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,8 @@ class Stage extends React.Component {
|
||||
'detachMouseEvents',
|
||||
'onMouseUp',
|
||||
'onMouseMove',
|
||||
'onMouseDown'
|
||||
'onMouseDown',
|
||||
'setCanvas'
|
||||
]);
|
||||
}
|
||||
componentDidMount () {
|
||||
@@ -68,6 +69,9 @@ class Stage extends React.Component {
|
||||
this.props.vm.postIOData('mouse', data);
|
||||
e.preventDefault();
|
||||
}
|
||||
setCanvas (canvas) {
|
||||
this.canvas = canvas;
|
||||
}
|
||||
render () {
|
||||
const {
|
||||
vm, // eslint-disable-line no-unused-vars
|
||||
@@ -75,7 +79,7 @@ class Stage extends React.Component {
|
||||
} = this.props;
|
||||
return (
|
||||
<StageComponent
|
||||
canvasRef={canvas => (this.canvas = canvas)}
|
||||
canvasRef={this.setCanvas}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user