@@ -40,7 +40,6 @@ const StateRoute = (props: StateRouteProps) => {
4040 const hierarchy = propsHierarchy || tabsHierarchy ;
4141 const viewIndex = propsViewIndex || tabsViewIndex ;
4242
43-
4443 // lines 45 - 63 contains functionality to disable the accessibility features in Reactime.
4544 const dispatch = useDispatch ( ) ;
4645 const [ showTree , setShowTree ] = useState ( false ) ;
@@ -64,95 +63,98 @@ const StateRoute = (props: StateRouteProps) => {
6463
6564 return (
6665 < div className = 'app-body' >
67- < div className = 'navbar' >
68- { /* all classnames below are functionally defined for styling purposes */ }
69- < NavLink
70- to = '/'
71- className = { ( navData ) =>
72- navData . isActive ? 'is-active router-link map-tab map-tab1' : 'router-link map-tab map-tab1'
73- }
74- end
75- >
76- Map
77- </ NavLink >
78- < NavLink
79- className = { ( navData ) =>
80- navData . isActive ? 'is-active router-link map-tab' : 'router-link map-tab'
81- }
82- to = '/performance'
83- >
84- Performance
85- </ NavLink >
86- < NavLink
87- className = { ( navData ) =>
88- navData . isActive ? 'is-active router-link history-tab' : 'router-link history-tab'
89- }
90- to = '/history'
91- >
92- History
93- </ NavLink >
94- < NavLink
95- className = { ( navData ) =>
96- navData . isActive
97- ? 'is-active router-link web-metrics-tab'
98- : 'router-link web-metrics-tab'
99- }
100- to = '/webMetrics'
101- >
102- Web Metrics
103- </ NavLink >
104- < NavLink
105- className = { ( navData ) =>
106- navData . isActive ? 'is-active router-link tree-tab' : 'router-link tree-tab'
107- }
108- to = '/tree'
109- >
110- Tree
111- </ NavLink >
112- < NavLink
113- className = { ( navData ) =>
114- navData . isActive
115- ? 'is-active router-link accessibility-tab'
116- : 'router-link accessibility-tab'
117- }
118- to = '/accessibility'
119- >
120- Accessibility
121- </ NavLink >
66+ < div className = 'main-navbar-container' >
67+ < div className = 'main-navbar' >
68+ < NavLink
69+ to = '/'
70+ className = { ( navData ) =>
71+ navData . isActive ? 'is-active router-link map-tab' : 'router-link map-tab'
72+ }
73+ end
74+ >
75+ Map
76+ </ NavLink >
77+ < NavLink
78+ className = { ( navData ) =>
79+ navData . isActive ? 'is-active router-link map-tab' : 'router-link map-tab'
80+ }
81+ to = '/performance'
82+ >
83+ Performance
84+ </ NavLink >
85+ < NavLink
86+ className = { ( navData ) =>
87+ navData . isActive ? 'is-active router-link history-tab' : 'router-link history-tab'
88+ }
89+ to = '/history'
90+ >
91+ History
92+ </ NavLink >
93+ < NavLink
94+ className = { ( navData ) =>
95+ navData . isActive
96+ ? 'is-active router-link web-metrics-tab'
97+ : 'router-link web-metrics-tab'
98+ }
99+ to = '/webMetrics'
100+ >
101+ Web Metrics
102+ </ NavLink >
103+ < NavLink
104+ className = { ( navData ) =>
105+ navData . isActive ? 'is-active router-link tree-tab' : 'router-link tree-tab'
106+ }
107+ to = '/tree'
108+ >
109+ Tree
110+ </ NavLink >
111+ < NavLink
112+ className = { ( navData ) =>
113+ navData . isActive
114+ ? 'is-active router-link accessibility-tab'
115+ : 'router-link accessibility-tab'
116+ }
117+ to = '/accessibility'
118+ >
119+ Accessibility
120+ </ NavLink >
121+ </ div >
122122 </ div >
123+
123124 < div className = 'app-content' >
124125 < Routes >
125126 < Route
126127 path = '/accessibility'
127128 element = {
128- // showTree is initially set to a falsely value, therefore, lines 155 - 189 is executed first. Once showTree is set to truthy by clicking the enable button, lines 129 - 154 is executed
129- // state is a key component here in order to update the accessibility tree
130129 showTree ? (
131130 < div >
132- < input
133- type = 'radio'
134- value = 'enable'
135- checked = { selectedValue === 'enable' }
136- onChange = { ( ) => {
137- enableAxTreeButton ( ) ;
138- } }
139- />
140- < label htmlFor = 'enable' > Enable</ label >
141- < input
142- type = 'radio'
143- value = 'disable'
144- checked = { selectedValue === 'disable' }
145- onChange = { ( ) => {
146- disableAxTree ( ) ;
147- } }
148- />
149- < label htmlFor = 'disable' > Disable</ label >
150- { showTree && < AxContainer
131+ < input
132+ type = 'radio'
133+ value = 'enable'
134+ checked = { selectedValue === 'enable' }
135+ onChange = { ( ) => {
136+ enableAxTreeButton ( ) ;
137+ } }
138+ />
139+ < label htmlFor = 'enable' > Enable</ label >
140+ < input
141+ type = 'radio'
142+ value = 'disable'
143+ checked = { selectedValue === 'disable' }
144+ onChange = { ( ) => {
145+ disableAxTree ( ) ;
146+ } }
147+ />
148+ < label htmlFor = 'disable' > Disable</ label >
149+ { /* @ts -ignore */ }
150+ { showTree && (
151+ < AxContainer
151152 axSnapshots = { axSnapshots }
152153 snapshot = { snapshot }
153154 snapshots = { snapshots }
154155 currLocation = { currLocation }
155- /> }
156+ />
157+ ) }
156158 </ div >
157159 ) : (
158160 < div >
@@ -165,33 +167,29 @@ const StateRoute = (props: StateRouteProps) => {
165167 </ p >
166168 ) }
167169 < div >
168- {
169- < input
170- type = 'radio'
171- value = 'enable'
172- checked = { selectedValue === 'enable' }
173- onChange = { ( ) => {
174- enableAxTreeButton ( ) ;
175- } }
176- />
177- }
170+ < input
171+ type = 'radio'
172+ value = 'enable'
173+ checked = { selectedValue === 'enable' }
174+ onChange = { ( ) => {
175+ enableAxTreeButton ( ) ;
176+ } }
177+ />
178178 < label htmlFor = 'enable' > Enable</ label >
179- {
180- < input
181- type = 'radio'
182- value = 'disable'
183- checked = { selectedValue === 'disable' }
184- onChange = { ( ) => {
185- disableAxTree ( ) ;
186- } }
187- />
188- }
179+ < input
180+ type = 'radio'
181+ value = 'disable'
182+ checked = { selectedValue === 'disable' }
183+ onChange = { ( ) => {
184+ disableAxTree ( ) ;
185+ } }
186+ />
189187 < label htmlFor = 'disable' > Disable</ label >
190188 </ div >
191189 </ div >
192190 )
193191 }
194- > </ Route >
192+ / >
195193 < Route
196194 path = '/history'
197195 element = {
@@ -202,8 +200,6 @@ const StateRoute = (props: StateRouteProps) => {
202200 width = { width }
203201 height = { height }
204202 hierarchy = { hierarchy }
205- // Commented out dispatch that was prop drilled as conversion to RTK might invalidate need for prop drilling to access dispatch
206- // dispatch={dispatch}
207203 sliderIndex = { sliderIndex }
208204 viewIndex = { viewIndex }
209205 currLocation = { currLocation }
@@ -227,7 +223,6 @@ const StateRoute = (props: StateRouteProps) => {
227223 width = { width }
228224 height = { height }
229225 snapshots = { snapshots }
230- // note: is propdrilled within Performance Visx, but doesn't seem to be used
231226 changeSlider = { changeSlider }
232227 changeView = { changeView }
233228 hierarchy = { hierarchy }
@@ -252,8 +247,7 @@ const StateRoute = (props: StateRouteProps) => {
252247 hierarchy ? (
253248 < ParentSize className = 'componentMapContainer' >
254249 { ( { width, height } ) => {
255- // eslint-disable-next-line react/prop-types
256- const maxHeight : number = 1200 ;
250+ const maxHeight = 1200 ;
257251 const h = Math . min ( height , maxHeight ) ;
258252 return (
259253 < ComponentMap
@@ -274,4 +268,3 @@ const StateRoute = (props: StateRouteProps) => {
274268} ;
275269
276270export default StateRoute ;
277-
0 commit comments