-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrendering.js
More file actions
38 lines (31 loc) · 989 Bytes
/
rendering.js
File metadata and controls
38 lines (31 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict'
const React = require('react')
const ReactDOM = require('react-dom')
const MuiThemeProvider = require('material-ui/styles/MuiThemeProvider').default
const RaisedButton = require('material-ui/RaisedButton').default
const wrapper = require('./lib/')
/*jshint ignore:start */
var mountnode = document.getElementById('mountnode')
if (mountnode) {
let opt = {
multiple: true,
accept: null,
fieldName: 'ajaxfile',
depth: 1
}
let FileButton = wrapper(RaisedButton, opt)
let styl = Object.assign(wrapper.styl, {marginRight: '5px'})
ReactDOM.render(
<MuiThemeProvider>
<div>
<FileButton label="click me" primary onFileInput={onFileInput} style={styl} />
<RaisedButton label="catch me" secondary style={styl} />
<RaisedButton label="catch me too" secondary style={styl} />
</div>
</MuiThemeProvider>,
mountnode)
}
function onFileInput(fileinput) {
console.log(fileinput)
console.log(fileinput.files)
}