Skip to content

Commit d7d87ac

Browse files
committed
attempting to pass in height referencing the parent size component of visx and how component map is rendering/passing in values
1 parent 832fc03 commit d7d87ac

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,26 @@ const StateRoute = (props: StateRouteProps) => {
102102
<Route
103103
path='/accessibility'
104104
element={
105-
<AxTree
106-
axSnapshots={axSnapshots}
107-
snapshot={snapshot}
108-
snapshots={snapshots}
109-
currLocation={currLocation}
110-
/>
105+
hierarchy ? (
106+
<ParentSize className='componentMapContainer'>
107+
{({ width, height }) => {
108+
// eslint-disable-next-line react/prop-types
109+
const maxHeight: number = 1200;
110+
const h = Math.min(height, maxHeight);
111+
console.log('h: ', h);
112+
return (
113+
<AxTree
114+
axSnapshots={axSnapshots}
115+
snapshot={snapshot}
116+
snapshots={snapshots}
117+
currLocation={currLocation}
118+
width={width}
119+
height={h}
120+
/>
121+
);
122+
}}
123+
</ParentSize>
124+
) : null
111125
}
112126
></Route>
113127
<Route
@@ -173,6 +187,7 @@ const StateRoute = (props: StateRouteProps) => {
173187
// eslint-disable-next-line react/prop-types
174188
const maxHeight: number = 1200;
175189
const h = Math.min(height, maxHeight);
190+
console.log('h component map: ', h);
176191
return (
177192
<ComponentMap
178193
currentSnapshot={currLocation.stateSnapshot}

0 commit comments

Comments
 (0)