This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from CrowdLinker/develop
Develop
- Loading branch information
Showing
24 changed files
with
1,039 additions
and
720 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 |
---|---|---|
|
@@ -6,4 +6,5 @@ node_modules | |
.rts2_cache_esm | ||
.rts2_cache_umd | ||
dist | ||
todo.txt | ||
todo.txt | ||
coverage |
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,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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
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
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
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,47 @@ | ||
import React, {useState} from 'react'; | ||
import {Pager, iPageInterpolation} from '@crowdlinker/react-native-pager'; | ||
import {Slide, NavigationButtons} from './shared-components'; | ||
import {View} from 'react-native'; | ||
import Animated from 'react-native-reanimated'; | ||
|
||
const {multiply, floor} = Animated; | ||
|
||
const verticalConfig: iPageInterpolation = { | ||
transform: [ | ||
{ | ||
scale: { | ||
inputRange: [-1, 0, 1], | ||
outputRange: [0.8, 1, 0.9], | ||
}, | ||
}, | ||
], | ||
|
||
opacity: { | ||
inputRange: [-1, 0, 1, 2, 3], | ||
outputRange: [1, 1, 1, 1, 0], | ||
}, | ||
|
||
zIndex: offset => multiply(floor(offset), -1), | ||
}; | ||
|
||
function VerticalPager() { | ||
const [activeIndex, onChange] = useState(2); | ||
|
||
return ( | ||
<View> | ||
<Pager | ||
type="vertical" | ||
activeIndex={activeIndex} | ||
onChange={onChange} | ||
style={{height: 200, width: 200, alignSelf: 'center', padding: 10}} | ||
pageInterpolation={verticalConfig}> | ||
{Array.from({length: activeIndex + 3}, (_, i) => ( | ||
<Slide key={i} /> | ||
))} | ||
</Pager> | ||
<NavigationButtons activeIndex={activeIndex} onChange={onChange} /> | ||
</View> | ||
); | ||
} | ||
|
||
export {VerticalPager}; |
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,65 @@ | ||
jest.mock('react-native-reanimated', () => { | ||
const React = require('react'); | ||
|
||
const View = require('react-native/Libraries/Components/View/View'); | ||
const mock = require('react-native-reanimated/mock'); | ||
|
||
mock.default.Value = function() { | ||
return { | ||
setValue: function() {}, | ||
}; | ||
}; | ||
|
||
function MockView(props) { | ||
React.useEffect(() => { | ||
props.onLayout && | ||
props.onLayout({ | ||
nativeEvent: { layout: { width: 100, height: 100 } }, | ||
}); | ||
}, []); | ||
|
||
return React.createElement(View, props, props.children); | ||
} | ||
|
||
mock.default.View = MockView; | ||
|
||
mock.default.useCode = function() {}; | ||
|
||
return mock; | ||
}); | ||
|
||
jest.mock('react-native-gesture-handler', () => { | ||
const View = require('react-native/Libraries/Components/View/View'); | ||
const TouchableOpacity = require('react-native/Libraries/Components/Touchable/TouchableOpacity'); | ||
return { | ||
Swipeable: View, | ||
DrawerLayout: View, | ||
State: {}, | ||
ScrollView: View, | ||
Slider: View, | ||
Switch: View, | ||
TextInput: View, | ||
ToolbarAndroid: View, | ||
ViewPagerAndroid: View, | ||
DrawerLayoutAndroid: View, | ||
WebView: View, | ||
NativeViewGestureHandler: View, | ||
TapGestureHandler: View, | ||
FlingGestureHandler: View, | ||
ForceTouchGestureHandler: View, | ||
LongPressGestureHandler: View, | ||
PanGestureHandler: View, | ||
PinchGestureHandler: View, | ||
RotationGestureHandler: View, | ||
/* Buttons */ | ||
RawButton: View, | ||
BaseButton: View, | ||
RectButton: View, | ||
BorderlessButton: View, | ||
TouchableOpacity: TouchableOpacity, | ||
/* Other */ | ||
FlatList: View, | ||
gestureHandlerRootHOC: jest.fn(), | ||
Directions: {}, | ||
}; | ||
}); |
Oops, something went wrong.