-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
00c98bf
commit 519dcf7
Showing
1 changed file
with
34 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,29 +1,55 @@ | ||
### Quick start | ||
<p align="center"> | ||
<img src="https://xxx-files.ggc.team/oss/rn-bounceable/logo.png" width="80%" title="Logo"> | ||
</p> | ||
|
||
Make sure you have [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) and [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) installed in your project. | ||
## Quick start | ||
|
||
```bash | ||
> yarn add rn-bounceable | ||
``` | ||
|
||
### Usage | ||
Make sure you have [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) and [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) installed in your project. | ||
|
||
## Usage | ||
|
||
```tsx | ||
import {Image} from 'react-native'; | ||
import {Bounceable} from 'rn-bounceable'; | ||
|
||
class OrdersScreen = () => { | ||
class Screen = () => { | ||
return ( | ||
<Bounceable onPress={() => alert('onPress')}> | ||
<Image source={imageSource} /> | ||
<Bounceable> | ||
<Image source={{uri: 'https://static.expo.dev/static/brand/square-512x512.png'}} /> | ||
</Bounceable> | ||
) | ||
} | ||
``` | ||
|
||
### Example | ||
##### Available props | ||
|
||
Example could be found under `expo-example` folder. | ||
```tsx | ||
type BounceableProps = { | ||
onPress?: () => void; | ||
onLongPress?: () => void; | ||
disabled?: boolean; // default: false | ||
noBounce?: boolean; // default: false | ||
immediatePress?: boolean; // default: true | ||
delayLongPress?: number; // default: 800 | ||
activeScale?: number; // default: 0.95 | ||
delayActiveScale?: number; // default: 0 | ||
springConfig?: Animated.WithSpringConfig; // default: { damping: 10, mass: 1, stiffness: 300 } | ||
contentContainerStyle?: StyleProp<ViewStyle>; | ||
}; | ||
``` | ||
|
||
## Example | ||
|
||
Examples could be found in `expo-example` folder or in [expo-starter](https://github.com/kanzitelli/expo-starter), [rn-starter](https://github.com/kanzitelli/rn-starter) and [rnn-starter](https://github.com/kanzitelli/rnn-starter). | ||
|
||
See it in Expo Go - https://expo.io/@kanzitelli/rn-bounceable-example. | ||
|
||
This library was bootstrapped from [kanzitelli/if-component](https://github.com/kanzitelli/if-component). | ||
|
||
## License | ||
|
||
This project is [MIT licensed](https://github.com/kanzitelli/rn-bounceable/blob/master/LICENSE.md) |