Skip to content

Commit c55b13f

Browse files
committed
moved slider into each route component
1 parent bcd1cba commit c55b13f

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

src/app/components/Actions/RouteDescription.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React from 'react';
2+
import Slider from 'rc-slider';
3+
import VerticalSlider from '../TimeTravel/VerticalSlider';
24

35
/*
46
Render's the red route description on app's left sided column between the clear button and the list of state snapshots. The route description is derived from the first state snapshot.
@@ -12,12 +14,26 @@ const RouteDescription = (props: RouteProps): JSX.Element => {
1214
const { actions } = props;
1315

1416
const url: URL = new URL(actions[0].props.routePath); // Use new URL to use the url.pathname method.
17+
1518
return (
16-
<div className='routedescription'>
17-
<h3 className='route'>Route: {url.pathname}</h3>
18-
{actions}
19-
</div>
19+
<div className='routedescription' >
20+
<h3 className='route'>Route: {url.pathname}</h3>
21+
<div style={{
22+
// div that contains slider and snapshots
23+
display: 'flex',
24+
flexDirection: 'row',
25+
height: `${actions.length * 30}px`,
26+
marginBottom: '50px'
27+
}}>
28+
<VerticalSlider className='main-slider' snapshots={actions} />
29+
<div style={{marginTop: '10px'}}>
30+
{/* actual snapshots per route */}
31+
{actions}
32+
</div>
33+
</div>
34+
</div>
2035
);
2136
};
2237

38+
2339
export default RouteDescription;

src/app/containers/ActionContainer.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import ProvConContainer from './ProvConContainer';
1010
import { ActionContainerProps, CurrentTab, MainState, Obj, RootState } from '../FrontendTypes';
1111
import { Button, Switch } from '@mui/material';
1212

13-
import Slider from 'rc-slider';
14-
import VerticalSlider from '../components/TimeTravel/VerticalSlider';
15-
1613
/*
1714
This file renders the 'ActionContainer'. The action container is the leftmost column in the application. It includes the button that shrinks and expands the action container, a dropdown to select the active site, a clear button, the current selected Route, and a list of selectable snapshots with timestamps.
1815
*/
@@ -261,16 +258,8 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
261258
{dropdownSelection === 'Provider/Consumer' && <ProvConContainer/>}
262259
{dropdownSelection === 'TimeJump' &&
263260
Object.keys(routes).map((route, i) => (
264-
<div style={{
265-
display: 'flex',
266-
flexDirection: 'row',
267-
height: `${routes[route].length * 4.5}vh`,
268-
marginBottom: '30px'
269-
}}>
270-
<VerticalSlider className='main-slider' snapshots={routes[route]}/>
271-
<RouteDescription key={`route${i}`} actions={routes[route]} />
272-
</div>
273-
))
261+
<RouteDescription key={`route${i}`} actions={routes[route]} />
262+
))
274263
}
275264
</div>
276265
</div>

0 commit comments

Comments
 (0)