Skip to content

Commit 9ad6bfd

Browse files
authored
Merge pull request #279 from netguru/fix/prepush
fix: prepush
2 parents 7e2284f + 703041b commit 9ad6bfd

File tree

9 files changed

+22
-13
lines changed

9 files changed

+22
-13
lines changed

jest/setupTests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
1+
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"example": "yarn --cwd example",
3434
"pods": "echo pods",
3535
"bootstrap": "yarn example && yarn && yarn pods",
36-
"prepush": "yarn test && yarn lint & yarn typescript"
36+
"prepush": "yarn lint && yarn typescript && yarn test"
3737
},
3838
"dependencies": {
3939
"prop-types": "^15.7.2"

src/StickyParallaxHeaderComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class StickyParallaxHeaderComponent extends Component<StickyParallaxHeaderProps,
439439
bouncesZoom
440440
decelerationRate={decelerationRate}
441441
nestedScrollEnabled
442-
ref={(c) => {
442+
ref={(c: ScrollView | Animated.LegacyRef<ScrollView> | null) => {
443443
this.scroll = getSafelyScrollNode(c) as ScrollView;
444444
setRef<ScrollView>(scrollRef, this.scroll);
445445
}}

src/components/ScrollableTabBar/ScrollableTabBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class ScrollableTabBar extends React.PureComponent<ScrollableTabBarProps, State>
194194
accessible
195195
style={[tabWrapperStyle, styles.noMargins]}
196196
accessibilityLabel={tabKey}
197-
accessibilityTraits="button"
197+
accessibilityRole="button"
198198
activeOpacity={0.9}
199199
onPress={() => this.goToPage(page)}>
200200
<View

src/components/ScrollableTabView/ScrollableTabView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ class ScrollableTabView extends React.Component<ScrollableTabViewProps, State> {
290290
pagingEnabled
291291
contentContainerStyle={{ minHeight: minScrollHeight }}
292292
automaticallyAdjustContentInsets={false}
293-
contentOffset={{ x: initialPage * containerWidth }}
294-
ref={(scrollView) => {
293+
contentOffset={{ x: initialPage * containerWidth, y: 0 }}
294+
ref={(scrollView: ScrollView | Animated.LegacyRef<ScrollView> | null) => {
295295
this.scrollView = getSafelyScrollNode(scrollView);
296296
}}
297297
onScroll={Animated.event([{ nativeEvent: { contentOffset: { x: scrollXIOS } } }], {

src/predefinedComponents/DetailsHeader/DetailsHeader.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ class DetailsHeader extends React.Component<DetailsHeaderProps, State> {
146146
const {
147147
headerLayout: { height },
148148
} = this.state;
149-
const headerBorderRadius =
150-
hasBorderRadius &&
151-
this.scrollY.y.interpolate({
152-
inputRange: [0, height],
153-
outputRange: [80, 0],
154-
extrapolate: 'extend',
155-
});
149+
const headerBorderRadius = hasBorderRadius
150+
? this.scrollY.y.interpolate({
151+
inputRange: [0, height],
152+
outputRange: [80, 0],
153+
extrapolate: 'extend',
154+
})
155+
: 0;
156156

157157
return (
158158
<Animated.View

src/tests/__snapshots__/AvatarHeader.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ exports[`AvatarHeader Test [Hacktoberfest] -Snapshot AvatarHeader 1`] = `
151151
scrollEventThrottle={1}
152152
showsVerticalScrollIndicator={false}
153153
stickyHeaderIndices={Array []}
154+
style={Object {}}
154155
>
155156
<View>
156157
<View
@@ -320,6 +321,7 @@ exports[`AvatarHeader Test [Hacktoberfest] -Snapshot AvatarHeader 1`] = `
320321
contentOffset={
321322
Object {
322323
"x": 0,
324+
"y": 0,
323325
}
324326
}
325327
directionalLockEnabled={true}
@@ -333,6 +335,7 @@ exports[`AvatarHeader Test [Hacktoberfest] -Snapshot AvatarHeader 1`] = `
333335
scrollEventThrottle={16}
334336
scrollsToTop={false}
335337
showsHorizontalScrollIndicator={false}
338+
style={Object {}}
336339
>
337340
<View />
338341
</RCTScrollView>

src/tests/__snapshots__/DetailsHeader.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ exports[`DetailsHeader empty Snapshot for default 1`] = `
128128
scrollEventThrottle={1}
129129
showsVerticalScrollIndicator={false}
130130
stickyHeaderIndices={Array []}
131+
style={Object {}}
131132
>
132133
<View>
133134
<View
@@ -325,6 +326,7 @@ exports[`DetailsHeader empty Snapshot for default 1`] = `
325326
contentOffset={
326327
Object {
327328
"x": 0,
329+
"y": 0,
328330
}
329331
}
330332
directionalLockEnabled={true}
@@ -338,6 +340,7 @@ exports[`DetailsHeader empty Snapshot for default 1`] = `
338340
scrollEventThrottle={16}
339341
scrollsToTop={false}
340342
showsHorizontalScrollIndicator={false}
343+
style={Object {}}
341344
>
342345
<View />
343346
</RCTScrollView>

src/tests/__snapshots__/StickyParallaxHeader.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ exports[`StickyParallaxHeader empty Snapshot for default 1`] = `
3333
scrollEventThrottle={1}
3434
showsVerticalScrollIndicator={false}
3535
stickyHeaderIndices={Array []}
36+
style={Object {}}
3637
>
3738
<View>
3839
<View
@@ -109,6 +110,7 @@ exports[`StickyParallaxHeader empty Snapshot for default 1`] = `
109110
contentOffset={
110111
Object {
111112
"x": 0,
113+
"y": 0,
112114
}
113115
}
114116
directionalLockEnabled={true}
@@ -122,6 +124,7 @@ exports[`StickyParallaxHeader empty Snapshot for default 1`] = `
122124
scrollEventThrottle={16}
123125
scrollsToTop={false}
124126
showsHorizontalScrollIndicator={false}
127+
style={Object {}}
125128
>
126129
<View />
127130
</RCTScrollView>

0 commit comments

Comments
 (0)