Skip to content

Commit

Permalink
Merge pull request #9114 from marmelab/improve-crm-demo-kanban
Browse files Browse the repository at this point in the history
[Demo] Improve CRM Demo Kanban code
  • Loading branch information
djhi authored Jul 20, 2023
2 parents b59f529 + da91a1c commit af66691
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 227 deletions.
16 changes: 6 additions & 10 deletions examples/crm/src/deals/DealColumn.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import * as React from 'react';
import { Box, Typography } from '@mui/material';
import { Droppable } from '@hello-pangea/dnd';
import { Identifier } from 'react-admin';
import { Box, Typography } from '@mui/material';

import { Deal } from '../types';
import { DealCard } from './DealCard';
import { stageNames } from './stages';
import { RecordMap } from './DealListContent';

export const DealColumn = ({
stage,
dealIds,
data,
deals,
}: {
stage: string;
dealIds: Identifier[];
data: RecordMap;
deals: Deal[];
}) => (
<Box
sx={{
Expand Down Expand Up @@ -52,8 +48,8 @@ export const DealColumn = ({
},
}}
>
{dealIds.map((id, index) => (
<DealCard key={id} index={index} deal={data[id]} />
{deals.map((deal, index) => (
<DealCard key={deal.id} deal={deal} index={index} />
))}
{droppableProvided.placeholder}
</Box>
Expand Down
Loading

0 comments on commit af66691

Please sign in to comment.