-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added patch to react-native-snap-carousel
• it was a known bug: meliorence/react-native-snap-carousel#992 (comment)
- Loading branch information
1 parent
3412b31
commit b6a2cce
Showing
4 changed files
with
159 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
import React from 'react'; | ||
import { SafeAreaView, StatusBar, StyleSheet, Text } from 'react-native'; | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { createStackNavigator } from '@react-navigation/stack'; | ||
|
||
import HomeView from './src/views/HomeView'; | ||
|
||
const Stack = createStackNavigator(); | ||
|
||
function App() { | ||
return ( | ||
<SafeAreaView> | ||
<StatusBar barStyle={'dark-content'} /> | ||
<Text>Hello World</Text> | ||
</SafeAreaView> | ||
<NavigationContainer> | ||
<Stack.Navigator | ||
initialRouteName="Home" | ||
screenOptions={{ | ||
gestureEnabled: true, | ||
gestureDirection: 'vertical', | ||
animationEnabled: false, | ||
}}> | ||
<Stack.Screen | ||
name="Home" | ||
component={HomeView} | ||
options={{ | ||
headerShown: true, // This is true by default as well | ||
}} | ||
/> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({}); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
diff --git a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js | ||
index dae71a3..a89205c 100644 | ||
--- a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js | ||
+++ b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js | ||
@@ -1,5 +1,5 @@ | ||
import React, { Component } from 'react'; | ||
-import { Animated, Easing, FlatList, I18nManager, Platform, ScrollView, View, ViewPropTypes } from 'react-native'; | ||
+import { Animated, Easing, FlatList, I18nManager, Platform, ScrollView, View } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import shallowCompare from 'react-addons-shallow-compare'; | ||
import { | ||
@@ -43,8 +43,8 @@ export default class Carousel extends Component { | ||
autoplayDelay: PropTypes.number, | ||
autoplayInterval: PropTypes.number, | ||
callbackOffsetMargin: PropTypes.number, | ||
- containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
- contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ containerCustomStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
+ contentContainerCustomStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
enableMomentum: PropTypes.bool, | ||
enableSnap: PropTypes.bool, | ||
firstItem: PropTypes.number, | ||
@@ -61,7 +61,7 @@ export default class Carousel extends Component { | ||
scrollEnabled: PropTypes.bool, | ||
scrollInterpolator: PropTypes.func, | ||
slideInterpolatedStyle: PropTypes.func, | ||
- slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ slideStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
shouldOptimizeUpdates: PropTypes.bool, | ||
swipeThreshold: PropTypes.number, | ||
useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), | ||
diff --git a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js | ||
index 5c021cf..44aa287 100644 | ||
--- a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js | ||
+++ b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js | ||
@@ -1,5 +1,5 @@ | ||
import React, { PureComponent } from 'react'; | ||
-import { I18nManager, Platform, View, ViewPropTypes } from 'react-native'; | ||
+import { I18nManager, Platform, View } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import PaginationDot from './PaginationDot'; | ||
import styles from './Pagination.style'; | ||
@@ -14,16 +14,16 @@ export default class Pagination extends PureComponent { | ||
dotsLength: PropTypes.number.isRequired, | ||
activeOpacity: PropTypes.number, | ||
carouselRef: PropTypes.object, | ||
- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
dotColor: PropTypes.string, | ||
- dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ dotContainerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
dotElement: PropTypes.element, | ||
- dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ dotStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
inactiveDotColor: PropTypes.string, | ||
inactiveDotElement: PropTypes.element, | ||
inactiveDotOpacity: PropTypes.number, | ||
inactiveDotScale: PropTypes.number, | ||
- inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ inactiveDotStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
renderDots: PropTypes.func, | ||
tappableDots: PropTypes.bool, | ||
vertical: PropTypes.bool, | ||
diff --git a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js | ||
index e59d196..3770c03 100644 | ||
--- a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js | ||
+++ b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js | ||
@@ -1,5 +1,5 @@ | ||
import React, { PureComponent } from 'react'; | ||
-import { View, Animated, Easing, TouchableOpacity, ViewPropTypes } from 'react-native'; | ||
+import { View, Animated, Easing, TouchableOpacity } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './Pagination.style'; | ||
|
||
@@ -12,11 +12,11 @@ export default class PaginationDot extends PureComponent { | ||
activeOpacity: PropTypes.number, | ||
carouselRef: PropTypes.object, | ||
color: PropTypes.string, | ||
- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
inactiveColor: PropTypes.string, | ||
- inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ inactiveStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
index: PropTypes.number, | ||
- style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
tappable: PropTypes.bool | ||
}; | ||
|
||
diff --git a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js | ||
index 8bc774a..3be5f83 100644 | ||
--- a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js | ||
+++ b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js | ||
@@ -1,7 +1,7 @@ | ||
// Parallax effect inspired by https://github.com/oblador/react-native-parallax/ | ||
|
||
import React, { Component } from 'react'; | ||
-import { View, ViewPropTypes, Image, Animated, Easing, ActivityIndicator, findNodeHandle } from 'react-native'; | ||
+import { View, Image, Animated, Easing, ActivityIndicator, findNodeHandle } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import styles from './ParallaxImage.style'; | ||
|
||
@@ -16,7 +16,7 @@ export default class ParallaxImage extends Component { | ||
sliderHeight: PropTypes.number, // passed from <Carousel /> | ||
sliderWidth: PropTypes.number, // passed from <Carousel /> | ||
vertical: PropTypes.bool, // passed from <Carousel /> | ||
- containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||
+ containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | ||
dimensions: PropTypes.shape({ | ||
width: PropTypes.number, | ||
height: PropTypes.number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { SafeAreaView, StyleSheet, Text } from 'react-native'; | ||
import React from 'react'; | ||
|
||
import Carousel from 'react-native-snap-carousel'; | ||
|
||
const HomeView = () => { | ||
return ( | ||
<SafeAreaView style={styles.rootContainerStyle}> | ||
<Text style={styles.textStyle}>Home View</Text> | ||
</SafeAreaView> | ||
); | ||
}; | ||
|
||
export default HomeView; | ||
|
||
const styles = StyleSheet.create({ | ||
rootContainerStyle: { | ||
backgroundColor: '#dddddd', | ||
}, | ||
textStyle: { | ||
color: '#222222', | ||
}, | ||
}); |