Skip to content

Commit

Permalink
fix/readme2
Browse files Browse the repository at this point in the history
  • Loading branch information
k0t1k777 committed Aug 19, 2024
1 parent 6619016 commit 2f20c7d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 36 additions & 5 deletions src/pages/Teams/Teams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -64,7 +96,6 @@ export default function Teams() {
}
return card;
};

const renderCardsServer = (card: membersProps) => {
if (!card.cellId || !card.subordinates) {
return null;
Expand Down

0 comments on commit 2f20c7d

Please sign in to comment.