better remove fromCollection
This commit is contained in:
parent
cfb3f048e4
commit
6c597570d1
|
@ -58,10 +58,6 @@ export default function FullScreenDropZone(props: Props) {
|
||||||
<DropDiv
|
<DropDiv
|
||||||
{...props.getRootProps({
|
{...props.getRootProps({
|
||||||
onDragEnter,
|
onDragEnter,
|
||||||
onDrop: (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
props.showCollectionSelector();
|
|
||||||
},
|
|
||||||
})}>
|
})}>
|
||||||
<input {...props.getInputProps()} />
|
<input {...props.getInputProps()} />
|
||||||
{isDragActive && (
|
{isDragActive && (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Card, Modal } from 'react-bootstrap';
|
import { Card, Modal } from 'react-bootstrap';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import {
|
import {
|
||||||
|
@ -46,6 +46,9 @@ function CollectionSelector({
|
||||||
collectionsAndTheirLatestFile,
|
collectionsAndTheirLatestFile,
|
||||||
...props
|
...props
|
||||||
}: Props) {
|
}: Props) {
|
||||||
|
const [collectionToShow, setCollectionToShow] = useState<
|
||||||
|
CollectionAndItsLatestFile[]
|
||||||
|
>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!attributes) {
|
if (!attributes) {
|
||||||
return;
|
return;
|
||||||
|
@ -56,15 +59,15 @@ function CollectionSelector({
|
||||||
if (collectionsOtherThanFrom.length === 0) {
|
if (collectionsOtherThanFrom.length === 0) {
|
||||||
props.onHide();
|
props.onHide();
|
||||||
attributes.showNextModal();
|
attributes.showNextModal();
|
||||||
|
} else {
|
||||||
|
setCollectionToShow(collectionsOtherThanFrom);
|
||||||
}
|
}
|
||||||
}, [props.show]);
|
}, [props.show]);
|
||||||
|
|
||||||
if (!attributes) {
|
if (!attributes) {
|
||||||
return <Modal />;
|
return <Modal />;
|
||||||
}
|
}
|
||||||
const CollectionIcons: JSX.Element[] = collectionsAndTheirLatestFile
|
const CollectionIcons: JSX.Element[] = collectionToShow?.map((item) => (
|
||||||
?.filter((item) => !(item.collection.id === attributes.fromCollection))
|
|
||||||
.map((item) => (
|
|
||||||
<CollectionIcon
|
<CollectionIcon
|
||||||
key={item.collection.id}
|
key={item.collection.id}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
Loading…
Reference in a new issue