Files
twenty_crm/front/src/modules/ui/components/board/BoardItem.tsx
Sammy Teillet c120903a45 Persist update on board drag and drop (#328)
* chore: move dnd lib comment aligned with import

* feature: add onUpdate on board

* chore: remove multi entity pipelines

* feature: add pipelineProgressableType field

* feature: fetch progressableType in board

* feature: implement on update to persist progress change
2023-06-20 10:56:36 +02:00

29 lines
975 B
TypeScript

import styled from '@emotion/styled';
import { DraggableProvided } from '@hello-pangea/dnd'; // Atlassian dnd does not support StrictMode from RN 18, so we use a fork @hello-pangea/dnd https://github.com/atlassian/react-beautiful-dnd/issues/2350
const StyledCard = styled.div`
background-color: ${({ theme }) => theme.secondaryBackground};
border: 1px solid ${({ theme }) => theme.quaternaryBackground};
border-radius: ${({ theme }) => theme.borderRadius};
box-shadow: ${({ theme }) => theme.boxShadow};
margin-bottom: ${({ theme }) => theme.spacing(2)};
max-width: 300px;
`;
type BoardCardProps = {
children: React.ReactNode;
draggableProvided?: DraggableProvided;
};
export const BoardItem = ({ children, draggableProvided }: BoardCardProps) => {
return (
<StyledCard
ref={draggableProvided?.innerRef}
{...draggableProvided?.dragHandleProps}
{...draggableProvided?.draggableProps}
>
{children}
</StyledCard>
);
};