mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
ImageUpload (first attmpt)
This commit is contained in:
parent
75fb88b209
commit
af3b413903
8 changed files with 179 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
import React, { FC } from 'react';
|
||||
import * as styles from './styles.scss';
|
||||
import { INode, IFileWithUUID } from '~/redux/types';
|
||||
import { INode } from '~/redux/types';
|
||||
|
||||
interface IProps {
|
||||
data: INode;
|
||||
|
|
|
@ -7,6 +7,7 @@ import { connect } from 'react-redux';
|
|||
import { selectUploads } from '~/redux/uploads/selectors';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import append from 'ramda/es/append';
|
||||
import { ImageUpload } from '~/components/upload/ImageUpload';
|
||||
|
||||
const mapStateToProps = selectUploads;
|
||||
const mapDispatchToProps = {
|
||||
|
@ -100,7 +101,25 @@ const ImageEditorUnconnected: FC<IProps> = ({ data, setData, uploadUploadFiles,
|
|||
|
||||
return (
|
||||
<form className={styles.uploads} onDrop={onDrop}>
|
||||
<div>{data.type}</div>
|
||||
{
|
||||
data.files.map(file => (
|
||||
<ImageUpload
|
||||
thumb={file.url}
|
||||
/>
|
||||
))
|
||||
}
|
||||
{
|
||||
temp.map(id => (
|
||||
statuses[id] && (
|
||||
<ImageUpload
|
||||
thumb={statuses[id].preview}
|
||||
progress={statuses[id].progress}
|
||||
is_uploading
|
||||
/>
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
<input type="file" onChange={onInputChange} accept="image/*" multiple />
|
||||
</form>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue