Created
February 25, 2015 01:23
-
-
Save ivanoats/917d99f808bdf422d10a to your computer and use it in GitHub Desktop.
WIP on drop zone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react/addons'; | |
export class RightDropZone extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
draggedOver: false | |
} | |
} | |
render() { | |
var cx = React.addons.classSet; | |
var classes = cx({ | |
'dragged-over': this.state.draggedOver | |
}); | |
return ( | |
<section | |
className={classes} | |
id="right-drop-zone" | |
onDragOver={this.handleDragOver.bind(this)} | |
style={this.state.style} | |
> | |
<p>Right Drop Zone</p> | |
</section> | |
); | |
} | |
handleDragOver(ev) { | |
ev.preventDefault(); | |
this.setState({draggedOver: true}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment