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.
- Loading branch information
Andrew Smith
authored and
Andrew Smith
committed
Sep 24, 2019
1 parent
2b6f533
commit 464da40
Showing
6 changed files
with
572 additions
and
9 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
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,57 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import {SingleStack, usePager} from '@crowdlinker/react-native-pager'; | ||
import {Slide, NavigationButtons} from './shared-components'; | ||
|
||
const rootConfig = { | ||
transform: [ | ||
{ | ||
scale: { | ||
inputRange: [-1, 0, 1], | ||
outputRange: [1.1, 1, 1.1], | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
const pageConfig = { | ||
transform: [ | ||
{ | ||
scale: { | ||
inputRange: [-1, 0, 1], | ||
outputRange: [0.9, 1, 0.9], | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
function SingleStackExample() { | ||
const [activeIndex, onChange] = usePager(); | ||
|
||
return ( | ||
<View style={{flex: 1, justifyContent: 'center'}}> | ||
<SingleStack | ||
style={{ | ||
width: 200, | ||
height: 200, | ||
alignSelf: 'center', | ||
padding: 5, | ||
}} | ||
rootIndex={2} | ||
rootInterpolation={rootConfig} | ||
pageInterpolation={pageConfig} | ||
activeIndex={activeIndex} | ||
onChange={onChange}> | ||
<Slide i={0} /> | ||
<Slide i={1} /> | ||
<Slide i={2} /> | ||
<Slide i={3} /> | ||
<Slide i={4} /> | ||
</SingleStack> | ||
|
||
<NavigationButtons activeIndex={activeIndex} onChange={onChange} /> | ||
</View> | ||
); | ||
} | ||
|
||
export {SingleStackExample}; |
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,2 +1,3 @@ | ||
export * from './pager'; | ||
export { Pager, PagerProvider, usePager } from './pager'; | ||
export * from './pagination'; | ||
export * from './single-stack'; |
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
Oops, something went wrong.