From 085ff7a37c873c97a673c1b4fc401605dab06a78 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 18 Nov 2024 15:50:33 +0300 Subject: [PATCH] feat: schizo sorting --- src/components/Dnd/Board/Board.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Dnd/Board/Board.tsx b/src/components/Dnd/Board/Board.tsx index 0d3634a..2eb51c1 100644 --- a/src/components/Dnd/Board/Board.tsx +++ b/src/components/Dnd/Board/Board.tsx @@ -98,7 +98,14 @@ export const Board: FC = ({ if (!aDate || !bDate) return 0; return aDate.getTime() - bDate.getTime(); }); - return [...firstRankData, ...secondRankData]; + return [...firstRankData, ...secondRankData].map((obj, index) => { + if (isGroup(obj)) { + obj.deals[0].rank = index; + return obj; + } + obj.rank = index; + return obj; + }) as (GroupWithDeals | DealSummary)[]; }; const renderDeal = (deal: DealSummary) => {