You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/app/components/StateRoute.jsx
+26-4Lines changed: 26 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,29 @@ import Chart from './Chart';
8
8
importTreefrom'./Tree';
9
9
10
10
// eslint-disable-next-line react/prop-types
11
-
constStateRoute=({ snapshot, hierarchy })=>(
11
+
12
+
constStateRoute=({ snapshot, hierarchy })=>{
13
+
// gabi :: the hierarchy get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if hierarchy was inicialize involk render chart
14
+
constrenderChart=()=>{
15
+
if(hierarchy){
16
+
return<Charthierarchy={hierarchy}/>
17
+
}
18
+
else{
19
+
return<divclassName='noState'> No state change detected. Trigger an event to change state </div>;
20
+
}
21
+
}
22
+
23
+
// gabi :: the snapshot get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if snapshot was inicialize involk render chart
24
+
constrenderTree=()=>{
25
+
if(hierarchy){
26
+
return<Treesnapshot={snapshot}/>
27
+
}
28
+
else{
29
+
return<divclassName='noState'> No state change detected. Trigger an event to change state </div>;
Copy file name to clipboardExpand all lines: src/app/containers/ActionContainer.jsx
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,13 @@ function ActionContainer() {
31
31
hierarchyArr.push(newObj)
32
32
if(obj.children){
33
33
obj.children.forEach((element)=>{
34
-
displayArray(element);
35
-
});
34
+
displayArray(element)
35
+
})
36
36
}
37
-
}
38
-
displayArray(hierarchy)
39
-
console.log('this is hierarchyArr',hierarchyArr)
37
+
}
38
+
// gabi :: the hierarchy get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if hierarchy was inicialize involk displayArray to display the hierarchy
39
+
if(hierarchy)displayArray(hierarchy)
40
+
// console.log('this is hierarchyArr', hierarchyArr)
40
41
41
42
// Edwin: handles keyboard presses, function passes an event and index of each action-component
0 commit comments