diff --git a/README.md b/README.md index 80dad05..8802c20 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ [**Макет Фигма**](https://www.figma.com/design/ccc8iapZ8bQ32EQyYqytgW/%D0%93%D0%B0%D0%B7%D0%BF%D1%80%D0%BE%D0%BC-ID-%D0%A5%D0%B0%D0%BA%D0%B0%D1%82%D0%BE%D0%BD%2B-%D0%9A%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D0%B0-1?node-id=42-2&t=M2QMAj7GoCSYpxNe-0) [**Ссылка на билд (Яндекс Диск)**]() +https://disk.yandex.ru/d/9E4E5sldBkSlwg [**Ссылка на скриншоты (Яндекс Диск)**]() https://disk.yandex.ru/d/vOj1T5xckxclFQ diff --git a/src/pages/Teams/Teams.tsx b/src/pages/Teams/Teams.tsx index 81cca97..9f43b28 100644 --- a/src/pages/Teams/Teams.tsx +++ b/src/pages/Teams/Teams.tsx @@ -46,10 +46,42 @@ export default function Teams() { if (card.subordinates && Array.isArray(card.subordinates)) { const updatedSubordinates = card.subordinates.map( (sub: membersProps, index: number) => { - const cellId = `${ - parentColom + - (index === 0 ? 0 : index === 1 ? 1 : index === 2 ? -1 : index - 2) - }-${parentRow + 1}`; + let cellId; + + if (card.subordinates && card.subordinates.length === 1) { + if (index === 0) { + cellId = `${parentColom}-${parentRow + 1}`; + } + } + if (card.subordinates && card.subordinates.length === 2) { + if (index === 0) { + cellId = `${parentColom}-${parentRow + 1}`; + } else if (index === 1) { + cellId = `${parentColom + 1}-${parentRow + 1}`; + } + } + + if (card.subordinates && card.subordinates.length === 3) { + if (index === 0) { + cellId = `${parentColom}-${parentRow + 1}`; + } else if (index === 1) { + cellId = `${parentColom + 1}-${parentRow + 1}`; + } else if (index === 2) { + cellId = `${parentColom - 1}-${parentRow + 1}`; + } + } + + if (card.subordinates && card.subordinates.length > 3) { + if (index === 0) { + cellId = `${parentColom}-${parentRow + 1}`; + } else if (index === 1) { + cellId = `${parentColom + 1}-${parentRow + 1}`; + } else if (index === 2) { + cellId = `${parentColom - 1}-${parentRow + 1}`; + } else if (index === 3) { + cellId = `${parentColom + 2}-${parentRow + 1}`; + } + } const updatedSub = updateSubordinates( sub, @@ -64,7 +96,6 @@ export default function Teams() { } return card; }; - const renderCardsServer = (card: membersProps) => { if (!card.cellId || !card.subordinates) { return null;