File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export const StepsIndicator = ({
18
18
} : {
19
19
options : number [ ] ;
20
20
sliderWidth : number ;
21
- currentValue ? : number ;
21
+ currentValue : number ;
22
22
StepMarker ?: FC < MarkerProps > ;
23
23
renderStepNumber ?: boolean ;
24
24
thumbImage ?: ImageSource ;
@@ -41,13 +41,16 @@ export const StepsIndicator = ({
41
41
{ values . map ( ( i , index ) => {
42
42
return (
43
43
< Fragment key = { index } >
44
- < View style = { styles . stepIndicatorElement } >
44
+ < View style = { styles . stepIndicatorElement } key = { ` ${ index } -View` } >
45
45
< SliderTrackMark
46
46
key = { `${ index } -SliderTrackMark` }
47
47
isTrue = { currentValue === i }
48
+ index = { i }
48
49
thumbImage = { thumbImage }
49
50
StepMarker = { StepMarker }
50
51
currentValue = { currentValue }
52
+ min = { options [ 0 ] }
53
+ max = { options [ options . length - 1 ] }
51
54
/>
52
55
{ renderStepNumber ? (
53
56
< StepNumber
Original file line number Diff line number Diff line change @@ -5,25 +5,40 @@ import {styles} from '../utils/styles';
5
5
export type MarkerProps = {
6
6
stepMarked : boolean ;
7
7
currentValue ?: number ;
8
+ index ?: number ;
9
+ min ?: number ;
10
+ max ?: number ;
8
11
} ;
9
12
10
13
export type TrackMarksProps = {
11
14
isTrue : boolean ;
15
+ index : number ;
12
16
thumbImage ?: ImageURISource ;
13
17
StepMarker ?: FC < MarkerProps > ;
14
- currentValue ?: number ;
18
+ currentValue : number ;
19
+ min : number ;
20
+ max : number ;
15
21
} ;
16
22
17
23
export const SliderTrackMark = ( {
18
24
isTrue,
25
+ index,
19
26
thumbImage,
20
27
StepMarker,
21
28
currentValue,
29
+ min,
30
+ max,
22
31
} : TrackMarksProps ) => {
23
32
return (
24
33
< View style = { styles . trackMarkContainer } >
25
34
{ StepMarker ? (
26
- < StepMarker stepMarked = { isTrue } currentValue = { currentValue } />
35
+ < StepMarker
36
+ stepMarked = { isTrue }
37
+ index = { index }
38
+ currentValue = { currentValue }
39
+ min = { min }
40
+ max = { max }
41
+ />
27
42
) : null }
28
43
{ thumbImage && isTrue ? (
29
44
< View style = { styles . thumbImageContainer } >
You can’t perform that action at this time.
0 commit comments