mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-13 12:24:03 +03:00
files: allow multiple files to be selected in finder for upload
This commit is contained in:
parent
db5bb6e281
commit
572f2c16e4
@ -87,10 +87,7 @@ export default class SidebarAddFileToBucket extends React.Component {
|
|||||||
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = files[i];
|
const file = files[i];
|
||||||
const slate =
|
const slate = this.props.data && this.props.data.slateId ? { id: this.props.data.slateId } : null;
|
||||||
this.props.data && this.props.data.slateId
|
|
||||||
? { id: this.props.data.slateId }
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const response = await this.props.onUploadFile({
|
const response = await this.props.onUploadFile({
|
||||||
file,
|
file,
|
||||||
@ -114,20 +111,12 @@ export default class SidebarAddFileToBucket extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<System.P style={{ fontFamily: Constants.font.semiBold }}>
|
<System.P style={{ fontFamily: Constants.font.semiBold }}>Upload data</System.P>
|
||||||
Upload data
|
<input css={STYLES_FILE_HIDDEN} type="file" multiple id="file" onChange={this._handleUpload} />
|
||||||
</System.P>
|
|
||||||
<input
|
|
||||||
css={STYLES_FILE_HIDDEN}
|
|
||||||
type="file"
|
|
||||||
id="file"
|
|
||||||
onChange={this._handleUpload}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{this.props.data && this.props.data.decorator === "SLATE" ? (
|
{this.props.data && this.props.data.decorator === "SLATE" ? (
|
||||||
<System.P style={{ marginTop: 24 }}>
|
<System.P style={{ marginTop: 24 }}>
|
||||||
This will add data to your Slate named{" "}
|
This will add data to your Slate named <strong>{this.props.data.slatename}</strong>.
|
||||||
<strong>{this.props.data.slatename}</strong>.
|
|
||||||
</System.P>
|
</System.P>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
@ -136,17 +125,12 @@ export default class SidebarAddFileToBucket extends React.Component {
|
|||||||
type="label"
|
type="label"
|
||||||
htmlFor="file"
|
htmlFor="file"
|
||||||
style={{ marginTop: 24 }}
|
style={{ marginTop: 24 }}
|
||||||
loading={!!this.props.fileLoading}
|
loading={!!this.props.fileLoading}>
|
||||||
>
|
|
||||||
Add file
|
Add file
|
||||||
</System.ButtonPrimary>
|
</System.ButtonPrimary>
|
||||||
|
|
||||||
{!this.props.fileLoading ? (
|
{!this.props.fileLoading ? (
|
||||||
<System.ButtonSecondary
|
<System.ButtonSecondary full style={{ marginTop: 16 }} onClick={this.props.onCancel}>
|
||||||
full
|
|
||||||
style={{ marginTop: 16 }}
|
|
||||||
onClick={this.props.onCancel}
|
|
||||||
>
|
|
||||||
Cancel
|
Cancel
|
||||||
</System.ButtonSecondary>
|
</System.ButtonSecondary>
|
||||||
) : null}
|
) : null}
|
||||||
|
Loading…
Reference in New Issue
Block a user