started creating spreadsheet component
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
/** @jsx React.DOM */
|
||||
|
||||
var React = require('react');
|
||||
|
||||
var ChooseFile = React.createClass({
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<button className="red-button">ChooseFile</button>
|
||||
);
|
||||
}
|
||||
getInitialState: function () {
|
||||
return {fileName: ""};
|
||||
},
|
||||
|
||||
render: function () {
|
||||
if (this.state.fileName === "") {
|
||||
return (<input type="file" accept=".csv" onChange={this._onChange}/>);
|
||||
} else
|
||||
return (<div>Editing file.</div>);
|
||||
},
|
||||
|
||||
_onChange: function(e) {
|
||||
this.setState({fileName: e.target.value})
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = ChooseFile;
|
||||
Reference in New Issue
Block a user