film-exif/src/views/HomeView.js

42 lines
781 B
JavaScript
Raw Normal View History

2018-04-03 14:13:16 -04:00
import {
Container,
Jumbotron,
Row,
2018-04-10 16:51:47 -04:00
} from '../components/Bootstrap';
2018-04-03 14:13:16 -04:00
2018-04-03 21:47:41 -04:00
function handleDrop (e) {
e.preventDefault();
e.stopPropagation();
2018-04-12 21:57:16 -04:00
// console.log(e.dataTransfer.files);
window.clientWS.send('dropped-files', e.dataTransfer.files);
2018-04-03 21:47:41 -04:00
for (const f of e.dataTransfer.files) {
console.log('Dragged files', f.path);
}
}
function handleDragOver (e) {
e.preventDefault();
e.stopPropagation();
}
2018-04-03 14:13:16 -04:00
export const HomeView = (props) => {
return (
2018-04-03 21:47:41 -04:00
<Jumbotron onDrop={handleDrop} onDragover={handleDragOver}>
2018-04-03 14:13:16 -04:00
<Container className="App">
<Row>
<header className="App-header">
2018-04-03 22:27:41 -04:00
<h1>Welcome to Film Exif</h1>
2018-04-03 14:13:16 -04:00
</header>
</Row>
<Row>
<p className="App-intro">
2018-04-03 22:27:41 -04:00
Drop files here.
2018-04-03 14:13:16 -04:00
</p>
</Row>
</Container>
</Jumbotron>
2018-04-03 15:19:45 -04:00
);
};