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