mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
dropping items
This commit is contained in:
parent
770f3cb2aa
commit
a957281d01
1 changed files with 7 additions and 7 deletions
|
@ -17,11 +17,11 @@ interface IProps {
|
||||||
locked: IUploadStatus[];
|
locked: IUploadStatus[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const SortableItem = SortableElement(({ children }) => (
|
const SortableImageGridItem = SortableElement(({ children }) => (
|
||||||
<div className={styles.item}>{children}</div>
|
<div className={styles.item}>{children}</div>
|
||||||
));
|
));
|
||||||
|
|
||||||
const SortableList = SortableContainer(
|
const SortableImageGrid = SortableContainer(
|
||||||
({
|
({
|
||||||
items,
|
items,
|
||||||
locked,
|
locked,
|
||||||
|
@ -35,15 +35,15 @@ const SortableList = SortableContainer(
|
||||||
{items
|
{items
|
||||||
.filter(file => file && file.id)
|
.filter(file => file && file.id)
|
||||||
.map((file, index) => (
|
.map((file, index) => (
|
||||||
<SortableItem key={file.id} index={index} collection={0}>
|
<SortableImageGridItem key={file.id} index={index} collection={0}>
|
||||||
<ImageUpload id={file.id} thumb={getURL(file)} onDrop={onDrop} />
|
<ImageUpload id={file.id} thumb={getURL(file)} onDrop={onDrop} />
|
||||||
</SortableItem>
|
</SortableImageGridItem>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{locked.map((item, index) => (
|
{locked.map((item, index) => (
|
||||||
<SortableItem key={item.temp_id} index={index} collection={1} disabled>
|
<SortableImageGridItem key={item.temp_id} index={index} collection={1} disabled>
|
||||||
<ImageUpload thumb={item.preview} progress={item.progress} is_uploading />
|
<ImageUpload thumb={item.preview} progress={item.progress} is_uploading />
|
||||||
</SortableItem>
|
</SortableImageGridItem>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -67,7 +67,7 @@ const ImageGrid: FC<IProps> = ({ data, setData, locked }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SortableList
|
<SortableImageGrid
|
||||||
onDrop={onDrop}
|
onDrop={onDrop}
|
||||||
onSortEnd={onMove}
|
onSortEnd={onMove}
|
||||||
axis="xy"
|
axis="xy"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue