@@ -33,11 +33,9 @@ const StateRoute = (props: StateRouteProps) => {
3333 webMetrics, // from 'tabs[currentTab]' object in 'MainContainer'
3434 currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
3535 } = props ;
36- console . log ( 'snapshot from StateRoute props: ' , snapshot ) ;
37- console . log ( 'snapshots from StateRoute props: ' , snapshots ) ;
38- console . log ( 'currLocation from StateRoute props' , currLocation ) ;
36+
3937 const { tabs, currentTab } : MainState = useSelector ( ( state : RootState ) => state . main ) ;
40- const { hierarchy : tabsHierarchy , sliderIndex, viewIndex : tabsViewIndex } = tabs [ currentTab ] ;
38+ const { hierarchy : tabsHierarchy , sliderIndex, viewIndex : tabsViewIndex } = tabs [ currentTab ] ;
4139 const hierarchy = propsHierarchy || tabsHierarchy ; //JR: RETURN TO THIS: alias to deconstruct from props and tab with the same name, aliases were deleted above
4240 const viewIndex = propsViewIndex || tabsViewIndex ;
4341
@@ -62,58 +60,81 @@ const StateRoute = (props: StateRouteProps) => {
6260 </ div >
6361 < div className = 'app-content' >
6462 < Routes >
65-
66- < Route path = '/history' element = { hierarchy ?
67- < ParentSize >
68- { ( { width, height } ) => (
69- < History
70- width = { width }
71- height = { height }
72- hierarchy = { hierarchy }
73- // Commented out dispatch that was prop drilled as conversion to RTK might invalidate need for prop drilling to access dispatch
74- // dispatch={dispatch}
75- sliderIndex = { sliderIndex }
76- viewIndex = { viewIndex }
77- currLocation = { currLocation }
78- snapshots = { snapshots }
79- />
80- ) }
81- </ ParentSize > : < div className = 'noState' > { NO_STATE_MSG } </ div > } />
82- < Route path = '/performance/*' element = { hierarchy ?
83- < div style = { { height : "100%" } } >
84- < ParentSize className = 'performanceContainer' >
85- { ( { width, height } ) => (
86- < PerformanceVisx
87- width = { width }
88- height = { height }
89- snapshots = { snapshots }
90- // note: is propdrilled within Performance Visx, but doesn't seem to be used
91- changeSlider = { changeSlider }
92- changeView = { changeView }
93- hierarchy = { hierarchy }
94- />
95- ) }
96- </ ParentSize >
97- < Outlet />
98- </ div >
99- : < div className = 'noState' > { NO_STATE_MSG } </ div >
100- } />
63+ < Route
64+ path = '/history'
65+ element = {
66+ hierarchy ? (
67+ < ParentSize >
68+ { ( { width, height } ) => (
69+ < History
70+ width = { width }
71+ height = { height }
72+ hierarchy = { hierarchy }
73+ // Commented out dispatch that was prop drilled as conversion to RTK might invalidate need for prop drilling to access dispatch
74+ // dispatch={dispatch}
75+ sliderIndex = { sliderIndex }
76+ viewIndex = { viewIndex }
77+ currLocation = { currLocation }
78+ snapshots = { snapshots }
79+ />
80+ ) }
81+ </ ParentSize >
82+ ) : (
83+ < div className = 'noState' > { NO_STATE_MSG } </ div >
84+ )
85+ }
86+ />
87+ < Route
88+ path = '/performance/*'
89+ element = {
90+ hierarchy ? (
91+ < div style = { { height : '100%' } } >
92+ < ParentSize className = 'performanceContainer' >
93+ { ( { width, height } ) => (
94+ < PerformanceVisx
95+ width = { width }
96+ height = { height }
97+ snapshots = { snapshots }
98+ // note: is propdrilled within Performance Visx, but doesn't seem to be used
99+ changeSlider = { changeSlider }
100+ changeView = { changeView }
101+ hierarchy = { hierarchy }
102+ />
103+ ) }
104+ </ ParentSize >
105+ < Outlet />
106+ </ div >
107+ ) : (
108+ < div className = 'noState' > { NO_STATE_MSG } </ div >
109+ )
110+ }
111+ />
101112 < Route path = '/webMetrics' element = { < WebMetricsContainer webMetrics = { webMetrics } /> } />
102- < Route path = '/tree' element = { < Tree snapshot = { snapshot } snapshots = { snapshots } currLocation = { currLocation } /> } />
103- < Route path = '*' element = { hierarchy ?
104- < ParentSize className = 'componentMapContainer' >
105- { ( { width, height } ) => {
106- // eslint-disable-next-line react/prop-types
107- const maxHeight : number = 1200 ;
108- const h = Math . min ( height , maxHeight )
109- return ( < ComponentMap
110- currentSnapshot = { currLocation . stateSnapshot }
111- width = { width }
112- height = { h }
113- /> )
114- } }
115- </ ParentSize >
116- : null } />
113+ < Route
114+ path = '/tree'
115+ element = { < Tree snapshot = { snapshot } snapshots = { snapshots } currLocation = { currLocation } /> }
116+ />
117+ < Route
118+ path = '*'
119+ element = {
120+ hierarchy ? (
121+ < ParentSize className = 'componentMapContainer' >
122+ { ( { width, height } ) => {
123+ // eslint-disable-next-line react/prop-types
124+ const maxHeight : number = 1200 ;
125+ const h = Math . min ( height , maxHeight ) ;
126+ return (
127+ < ComponentMap
128+ currentSnapshot = { currLocation . stateSnapshot }
129+ width = { width }
130+ height = { h }
131+ />
132+ ) ;
133+ } }
134+ </ ParentSize >
135+ ) : null
136+ }
137+ />
117138 </ Routes >
118139 </ div >
119140 </ div >
0 commit comments