Skip to content

Commit 4d4bba5

Browse files
committed
accessibliity tab now has time travel instead of whole axsnapshots array
1 parent 70155c3 commit 4d4bba5

File tree

2 files changed

+50
-54
lines changed

2 files changed

+50
-54
lines changed

src/app/components/StateRoute/Ax.tsx

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,52 @@ import { setCurrentTabInApp } from '../../slices/mainSlice';
44
import { useDispatch } from 'react-redux';
55

66
const theme = {
7-
scheme: 'monokai',
8-
author: 'wimer hazenberg (http://www.monokai.nl)',
9-
base00: '#272822',
10-
base01: '#383830',
11-
base02: '#49483e',
12-
base03: '#75715e',
13-
base04: '#a59f85',
14-
base05: '#f8f8f2',
15-
base06: '#f5f4f1',
16-
base07: '#f9f8f5',
17-
base08: '#f92672',
18-
base09: '#fd971f',
19-
base0A: '#f4bf75',
20-
base0B: '#a6e22e',
21-
base0C: '#a1efe4',
22-
base0D: '#66d9ef',
23-
base0E: '#ae81ff',
24-
base0F: '#cc6633',
25-
};
7+
scheme: 'monokai',
8+
author: 'wimer hazenberg (http://www.monokai.nl)',
9+
base00: '#272822',
10+
base01: '#383830',
11+
base02: '#49483e',
12+
base03: '#75715e',
13+
base04: '#a59f85',
14+
base05: '#f8f8f2',
15+
base06: '#f5f4f1',
16+
base07: '#f9f8f5',
17+
base08: '#f92672',
18+
base09: '#fd971f',
19+
base0A: '#f4bf75',
20+
base0B: '#a6e22e',
21+
base0C: '#a1efe4',
22+
base0D: '#66d9ef',
23+
base0E: '#ae81ff',
24+
base0F: '#cc6633',
25+
};
2626

2727
const AxTree = (props) => {
28-
const {
29-
snapshot, // from 'tabs[currentTab]' object in 'MainContainer'
30-
snapshots, // from 'tabs[currentTab].snapshotDisplay' object in 'MainContainer'
31-
currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
32-
axSnapshots,
33-
} = props;
28+
const {
29+
snapshot, // from 'tabs[currentTab]' object in 'MainContainer'
30+
snapshots, // from 'tabs[currentTab].snapshotDisplay' object in 'MainContainer'
31+
currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
32+
axSnapshots,
33+
} = props;
3434

35-
const dispatch = useDispatch();
35+
const dispatch = useDispatch();
3636

37-
useEffect(() => {
38-
dispatch(setCurrentTabInApp('AxTree')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'tree' to facilitate render.
39-
}, []);
37+
useEffect(() => {
38+
dispatch(setCurrentTabInApp('AxTree')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'tree' to facilitate render.
39+
}, []);
4040

41-
//removing/adding snapshot at beginning of return statement didn't change anything
42-
return(
43-
<> {snapshot && (
44-
<JSONTree
45-
data={axSnapshots}
46-
// shouldExpandNodeInitially={() => true}
47-
theme = {theme}
48-
/>
49-
)}
50-
</>
51-
)
52-
}
53-
export default AxTree;
41+
//removing/adding snapshot at beginning of return statement didn't change anything
42+
return (
43+
<>
44+
{' '}
45+
{snapshot && (
46+
<JSONTree
47+
data={axSnapshots[currLocation.index]}
48+
shouldExpandNodeInitially={() => true}
49+
theme={theme}
50+
/>
51+
)}
52+
</>
53+
);
54+
};
55+
export default AxTree;

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,16 @@ const StateRoute = (props: StateRouteProps) => {
100100
<div className='app-content'>
101101
<Routes>
102102
<Route
103-
<<<<<<< HEAD
104103
path='/accessibility'
105104
element={
106-
<AxTree snapshot={snapshot} snapshots={snapshots} currLocation={currLocation} />
105+
<AxTree
106+
axSnapshots={axSnapshots}
107+
snapshot={snapshot}
108+
snapshots={snapshots}
109+
currLocation={currLocation}
110+
/>
107111
}
108112
></Route>
109-
=======
110-
path = '/accessibility'
111-
element = {<AxTree
112-
axSnapshots={axSnapshots}
113-
snapshot={snapshot}
114-
snapshots={snapshots}
115-
currLocation={currLocation}/>}
116-
>
117-
</Route>
118-
>>>>>>> develop
119113
<Route
120114
path='/history'
121115
element={

0 commit comments

Comments
 (0)