File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
src/components/segmentedControl Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const {interpolate: _interpolate, interpolateNode} = Reanimated;
11
11
const interpolate = interpolateNode || _interpolate ;
12
12
const Easing = EasingNode || _Easing ;
13
13
const BORDER_WIDTH = 1 ;
14
- const HORIZONTAL_PADDING = Spacings . s2 ;
15
14
16
15
export type SegmentedControlItemProps = SegmentProps ;
17
16
export type SegmentedControlProps = {
@@ -115,7 +114,7 @@ const SegmentedControl = (props: SegmentedControlProps) => {
115
114
const onLayout = useCallback ( ( index : number , event : LayoutChangeEvent ) => {
116
115
const { x, width, height} = event . nativeEvent . layout ;
117
116
segmentsStyle . current [ index ] = { x, width} ;
118
- segmentedControlHeight . current = height + 2 * ( HORIZONTAL_PADDING - BORDER_WIDTH ) ;
117
+ segmentedControlHeight . current = height - 2 * BORDER_WIDTH ;
119
118
segmentsCounter . current ++ ;
120
119
121
120
return segmentsCounter . current === segments ?. length && setSelectedSegment ( initialIndex ) ;
@@ -184,7 +183,6 @@ const styles = StyleSheet.create({
184
183
container : {
185
184
backgroundColor : Colors . grey80 ,
186
185
borderColor : Colors . grey60 ,
187
- paddingVertical : HORIZONTAL_PADDING ,
188
186
borderWidth : BORDER_WIDTH
189
187
} ,
190
188
selectedSegment : {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ const Segment = React.memo((props: SegmentProps) => {
74
74
const segmentedColor = useMemo ( ( ) => ( isSelected ? activeColor : inactiveColor ) ,
75
75
[ isSelected , activeColor , inactiveColor ] ) ;
76
76
77
- const segmentStyle = useMemo ( ( ) => ( { paddingHorizontal : Spacings . s3 , borderColor : segmentedColor } ) , [ segmentedColor ] ) ;
77
+ const segmentStyle = useMemo ( ( ) => ( { paddingHorizontal : Spacings . s3 , paddingVertical : Spacings . s2 } ) , [ ] ) ;
78
78
79
79
const renderIcon = useCallback ( ( ) => {
80
80
return iconSource && < Image source = { iconSource } style = { [ { tintColor : segmentedColor } , iconStyle ] } /> ;
You can’t perform that action at this time.
0 commit comments