Skip to content

Commit 2adef8f

Browse files
committed
intial experimentation with JSONTree formatting and importinf that usage into a new accessibility react tab
1 parent d6d5912 commit 2adef8f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/app/components/StateRoute/Ax.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import { JSONTree } from 'react-json-tree'; // React JSON Viewer Component
3+
4+
const json = {
5+
array: [1, 2, 3],
6+
bool: true,
7+
object: {
8+
foo: 'bar',
9+
},
10+
}
11+
const AxTree = () => {
12+
return(
13+
<JSONTree data={json} />
14+
)
15+
}
16+
export default AxTree;

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useSelector } from 'react-redux';
1515
import PerformanceVisx from './PerformanceVisx/PerformanceVisx';
1616
import WebMetricsContainer from './WebMetrics/WebMetricsContainer';
1717
import { MainState, RootState, StateRouteProps } from '../../FrontendTypes';
18+
import AxTree from './Ax';
1819

1920
/*
2021
Loads the appropriate StateRoute view and renders the Map, Performance, History, Webmetrics, and Tree navbar buttons after clicking on the 'State' button located near the top rightmost corner.
@@ -84,9 +85,22 @@ const StateRoute = (props: StateRouteProps) => {
8485
>
8586
Tree
8687
</NavLink>
88+
<NavLink
89+
className = {(navData) =>
90+
navData.isActive ? 'is-active router-link accessibility-tab' : 'router-link accessibility-tab'
91+
}
92+
to = '/accessibility'
93+
>
94+
Accessibility
95+
</NavLink>
8796
</div>
8897
<div className='app-content'>
8998
<Routes>
99+
<Route
100+
path = '/accessibility'
101+
element = {<AxTree/>}
102+
>
103+
</Route>
90104
<Route
91105
path='/history'
92106
element={

0 commit comments

Comments
 (0)