From 9f6663b1dfc4c48a0e923c8cc957e8acd4d07e5e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 1 Oct 2021 17:28:06 +0200 Subject: [PATCH] Reorganization of icons --- .../Spaces/User-Profile-Space/UserProfile.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 4c876cdee..315329d1b 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -63,25 +63,30 @@ function newGovernanceUserProfileSpace() { const SPACE_WIDTH = UI.projects.foundations.spaces.floatingSpace.container.frame.width const SPACE_HEIGHT = UI.projects.foundations.spaces.floatingSpace.container.frame.height - arrangeNodes(userProfiles, SPACE_HEIGHT * 0.425, 3000) - arrangeNodes(pools, SPACE_HEIGHT * 0.595, 0) - arrangeNodes(features, SPACE_HEIGHT * 0.635, 0) - arrangeNodes(positions, SPACE_HEIGHT * 0.675, 0) - arrangeNodes(assets, SPACE_HEIGHT * 0.835, 3000) + arrangeNodes(userProfiles, SPACE_HEIGHT * 0.345, 3000, 4) + arrangeNodes(pools, SPACE_HEIGHT * 0.590, 0, 1) + arrangeNodes(features, SPACE_HEIGHT * 0.620, 0, 1) + arrangeNodes(positions, SPACE_HEIGHT * 0.670, 0, 1) + arrangeNodes(assets, SPACE_HEIGHT * 0.755, 3000, 4) - function arrangeNodes(nodes, yLevel, yStep) { + function arrangeNodes(nodes, yLevel, yStep, rows) { /* Here we will change the Y position of all profiles so that they are all at the same level. */ - const X_STEP = SPACE_WIDTH / (nodes.length + 1) + const X_STEP = SPACE_WIDTH / (nodes.length + 1 + 1 * rows) * rows let xOffset = X_STEP let yOffset = 0 + let xStepCount = 0 for (let i = 0; i < nodes.length; i++) { nodes[i].payload.floatingObject.container.frame.position.x = xOffset - xOffset = xOffset + X_STEP + xStepCount++ + if (xStepCount === rows) { + xOffset = xOffset + X_STEP + xStepCount = 0 + } } for (let i = 0; i < nodes.length; i++) { switch (true) { @@ -94,18 +99,10 @@ function newGovernanceUserProfileSpace() { break } case (yOffset === yStep * 2): { - yOffset = yStep * 1 + 1 + yOffset = yStep * 3 break } - case (yOffset === yStep * 1 + 1): { - yOffset = yStep * 0 + 1 - break - } - case (yOffset === yStep * 0 + 1): { - yOffset = -yStep - break - } - case (yOffset === -yStep): { + case (yOffset === yStep * 3): { yOffset = 0 break }