refactor: removed constant sizes
This commit is contained in:
@ -69,7 +69,7 @@ const FunnelDnd = <
|
||||
containers.map(container => {
|
||||
const containerItems = getItemsByContainer(container, items);
|
||||
const containerId = getContainerId(container);
|
||||
return (
|
||||
const item = (
|
||||
<SortableItem
|
||||
key={containerId}
|
||||
id={containerId}
|
||||
@ -86,11 +86,13 @@ const FunnelDnd = <
|
||||
}
|
||||
/>
|
||||
);
|
||||
if (!isMobile) return item;
|
||||
return <Carousel.Slide key={containerId}>{item}</Carousel.Slide>;
|
||||
});
|
||||
|
||||
const renderBody = () => (
|
||||
<>
|
||||
{isMobile ? (
|
||||
const renderBody = () => {
|
||||
if (isMobile) {
|
||||
return (
|
||||
<Carousel
|
||||
slideSize={"80%"}
|
||||
slideGap={"md"}
|
||||
@ -101,31 +103,17 @@ const FunnelDnd = <
|
||||
{renderContainers()}
|
||||
<CreateStatusButton />
|
||||
</Carousel>
|
||||
) : (
|
||||
renderContainers()
|
||||
)}
|
||||
<FunnelOverlay
|
||||
activeContainer={activeContainer}
|
||||
activeItem={activeItem}
|
||||
renderContainer={container => {
|
||||
const containerItems = getItemsByContainer(
|
||||
container,
|
||||
items
|
||||
);
|
||||
const containerId = getContainerId(container);
|
||||
return renderContainerOverlay(
|
||||
container,
|
||||
<FunnelColumn
|
||||
id={containerId}
|
||||
items={containerItems}
|
||||
renderItem={renderItem}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
renderItem={renderItemOverlay}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Group
|
||||
gap={"xs"}
|
||||
wrap="nowrap"
|
||||
align="start">
|
||||
{renderContainers()}
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<DndContext
|
||||
@ -137,16 +125,27 @@ const FunnelDnd = <
|
||||
<SortableContext
|
||||
items={containers.map(getContainerId)}
|
||||
strategy={horizontalListSortingStrategy}>
|
||||
{isMobile ? (
|
||||
renderBody()
|
||||
) : (
|
||||
<Group
|
||||
gap={0}
|
||||
wrap="nowrap"
|
||||
align="start">
|
||||
{renderBody()}
|
||||
</Group>
|
||||
)}
|
||||
{renderBody()}
|
||||
<FunnelOverlay
|
||||
activeContainer={activeContainer}
|
||||
activeItem={activeItem}
|
||||
renderContainer={container => {
|
||||
const containerItems = getItemsByContainer(
|
||||
container,
|
||||
items
|
||||
);
|
||||
const containerId = getContainerId(container);
|
||||
return renderContainerOverlay(
|
||||
container,
|
||||
<FunnelColumn
|
||||
id={containerId}
|
||||
items={containerItems}
|
||||
renderItem={renderItem}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
renderItem={renderItemOverlay}
|
||||
/>
|
||||
</SortableContext>
|
||||
</DndContext>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user