|
@@ -1,33 +1,32 @@
|
|
|
-const { h } = require('preact')
|
|
|
+const { h, Component } = require('preact')
|
|
|
const hyperx = require('hyperx')
|
|
|
const html = hyperx(h)
|
|
|
|
|
|
-let inputEl
|
|
|
-
|
|
|
-module.exports = (props) => {
|
|
|
- const input = html`
|
|
|
- <input class="UppyDashboard-input"
|
|
|
- hidden="true"
|
|
|
- aria-hidden="true"
|
|
|
- tabindex="-1"
|
|
|
- type="file"
|
|
|
- name="files[]"
|
|
|
- multiple="true"
|
|
|
- onchange=${props.handleInputChange}
|
|
|
- ref=${(input) => {
|
|
|
- inputEl = input
|
|
|
- }} />`
|
|
|
-
|
|
|
- return html`
|
|
|
- <span>
|
|
|
- ${props.acquirers.length === 0
|
|
|
- ? props.i18n('dropPaste')
|
|
|
- : props.i18n('dropPasteImport')
|
|
|
- }
|
|
|
- <button type="button"
|
|
|
- class="UppyDashboard-browse"
|
|
|
- onclick=${(ev) => inputEl.click()}>${props.i18n('browse')}</button>
|
|
|
- ${input}
|
|
|
- </span>
|
|
|
- `
|
|
|
+class ActionBrowseTagline extends Component {
|
|
|
+ render () {
|
|
|
+ return html`
|
|
|
+ <span>
|
|
|
+ ${this.props.acquirers.length === 0
|
|
|
+ ? this.props.i18n('dropPaste')
|
|
|
+ : this.props.i18n('dropPasteImport')
|
|
|
+ }
|
|
|
+ <button type="button"
|
|
|
+ class="UppyDashboard-browse"
|
|
|
+ onclick=${(ev) => this.input.click()}>${this.props.i18n('browse')}</button>
|
|
|
+ <input class="UppyDashboard-input"
|
|
|
+ hidden="true"
|
|
|
+ aria-hidden="true"
|
|
|
+ tabindex="-1"
|
|
|
+ type="file"
|
|
|
+ name="files[]"
|
|
|
+ multiple="true"
|
|
|
+ onchange=${this.props.handleInputChange}
|
|
|
+ ref=${(input) => {
|
|
|
+ this.input = input
|
|
|
+ }} />
|
|
|
+ </span>
|
|
|
+ `
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+module.exports = ActionBrowseTagline
|