Skip to content

Commit 46549c8

Browse files
committed
styled slider thumb
1 parent 717f87d commit 46549c8

File tree

2 files changed

+149
-193
lines changed

2 files changed

+149
-193
lines changed

src/app/containers/ActionContainer.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ import { Button, Switch } from '@mui/material';
1515
*/
1616

1717
// resetSlider locates the rc-slider elements on the document and resets it's style attributes
18-
const resetSlider = () => {
19-
const slider = document.querySelector('.rc-slider-handle');
20-
const sliderTrack = document.querySelector('.rc-slider-track');
21-
if (slider && sliderTrack) {
22-
slider.setAttribute('style', 'left: 0');
23-
sliderTrack.setAttribute('style', 'width: 0');
24-
}
25-
};
2618

2719
function ActionContainer(props: ActionContainerProps): JSX.Element {
2820
const [dropdownSelection, setDropdownSelection] = useState('TimeJump');
@@ -41,22 +33,6 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
4133
// we create an array 'hierarchyArr' that will hold objects and numbers
4234
const hierarchyArr: (number | {})[] = [];
4335

44-
/*
45-
function to traverse state from hierarchy and also getting information on display name and component name
46-
47-
the obj parameter is an object with the following structure:
48-
{
49-
stateSnapshot: {
50-
route: any;
51-
children: any[];
52-
};
53-
name: number;
54-
branch: number;
55-
index: number;
56-
children?: [];
57-
}
58-
*/
59-
6036
const displayArray = (obj: Obj): void => {
6137
if (
6238
obj.stateSnapshot.children.length > 0 && // if the 'stateSnapshot' has a non-empty 'children' array
@@ -238,7 +214,7 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
238214
variant='text'
239215
onClick={() => {
240216
dispatch(emptySnapshots()); // set slider back to zero, visually
241-
resetSlider();
217+
dispatch(changeSlider(0));
242218
}}
243219
type='button'
244220
>

0 commit comments

Comments
 (0)