Skip to content

Commit 1edc40b

Browse files
yuanjackie1jasnoo
authored andcommitted
Full TS implementation on MainSliders.tsx
1 parent 1a48a11 commit 1edc40b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/app/components/MainSlider.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@ import Slider from 'rc-slider';
33
import Tooltip from 'rc-tooltip';
44
import { changeSlider, pause } from '../actions/actions';
55
import { useStoreContext } from '../store';
6+
import { HandleProps, MainSliderProps } from '../components/FrontendTypes';
67

78
const { Handle } = Slider;
89

9-
interface handleProps {
10-
value: number;
11-
dragging: boolean;
12-
index: number;
13-
}
14-
15-
const handle = (props: handleProps) => {
10+
const handle = (props: HandleProps): JSX.Element => {
1611
const { value, dragging, index, ...restProps } = props;
1712

1813
return (
@@ -28,11 +23,8 @@ const handle = (props: handleProps) => {
2823
);
2924
};
3025

31-
interface MainSliderProps {
32-
snapshotsLength: number;
33-
}
3426

35-
function MainSlider(props: MainSliderProps) {
27+
function MainSlider(props: MainSliderProps): JSX.Element {
3628
const { snapshotsLength } = props;
3729
const [{ tabs, currentTab }, dispatch] = useStoreContext();
3830
const { currLocation } = tabs[currentTab];

0 commit comments

Comments
 (0)