@@ -9,7 +9,7 @@ import {Constants, asBaseComponent, forwardRef, BaseComponentInjectedProps, Forw
9
9
import View from '../view' ;
10
10
import { Colors , Spacings , Typography } from '../../style' ;
11
11
import FadedScrollView from '../fadedScrollView' ;
12
-
12
+ import { FaderProps } from '../fader' ;
13
13
import useScrollToItem from './useScrollToItem' ;
14
14
import { orientations } from '../../commons/Constants' ;
15
15
import { useDidUpdate } from 'hooks' ;
@@ -27,6 +27,8 @@ const DEFAULT_SELECTED_LABEL_STYLE = {
27
27
letterSpacing : 0
28
28
} ;
29
29
30
+ const DEFAULT_FADER_PROPS = { size : 76 , tintColor : Colors . $backgroundElevated } ;
31
+
30
32
export interface TabControllerBarProps {
31
33
/**
32
34
* The list of tab bar items
@@ -85,6 +87,10 @@ export interface TabControllerBarProps {
85
87
* The TabBar background Color
86
88
*/
87
89
backgroundColor ?: string ;
90
+ /**
91
+ * Props for the start \ end faders
92
+ */
93
+ faderProps ?: Pick < FaderProps , 'size' | 'tintColor' > ;
88
94
/**
89
95
* The TabBar container width
90
96
*/
@@ -121,8 +127,6 @@ interface Props extends TabControllerBarProps, BaseComponentInjectedProps, Forwa
121
127
children ?: ChildProps [ ] | ChildProps ;
122
128
}
123
129
124
- const FADER_PROPS = { size : 76 , tintColor : Colors . $backgroundElevated } ;
125
-
126
130
/**
127
131
* @description : TabController's TabBar component
128
132
* @example : https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx
@@ -143,6 +147,7 @@ const TabBar = (props: Props) => {
143
147
selectedIconColor,
144
148
activeBackgroundColor,
145
149
backgroundColor,
150
+ faderProps,
146
151
containerWidth : propsContainerWidth ,
147
152
centerSelected,
148
153
spreadItems,
@@ -292,9 +297,9 @@ const TabBar = (props: Props) => {
292
297
horizontal
293
298
showsHorizontalScrollIndicator = { false }
294
299
showStartFader
295
- startFaderProps = { FADER_PROPS }
300
+ startFaderProps = { faderProps }
296
301
showEndFader
297
- endFaderProps = { FADER_PROPS }
302
+ endFaderProps = { faderProps }
298
303
contentContainerStyle = { scrollViewContainerStyle }
299
304
testID = { testID }
300
305
onContentSizeChange = { onContentSizeChange }
@@ -314,6 +319,7 @@ TabBar.defaultProps = {
314
319
labelStyle : DEFAULT_LABEL_STYLE ,
315
320
selectedLabelStyle : DEFAULT_SELECTED_LABEL_STYLE ,
316
321
backgroundColor : DEFAULT_BACKGROUND_COLOR ,
322
+ faderProps : DEFAULT_FADER_PROPS ,
317
323
spreadItems : true
318
324
} ;
319
325
0 commit comments