Skip to content

Commit

Permalink
feat: improvements, fixes and new props (#115)
Browse files Browse the repository at this point in the history
* fix: header component pan gesture handler for Android

* feat: added new props and fixed keyboard handling

* fix: options import for case sensetive fs

* docs: fixed examples

* docs: added new props

* fix: examples

* Revert "docs: fixed examples"

This reverts commit 8696e78.

* fix: watch:react-navigation script

* fix: simplified handling of the modal height and keyboard handling

* fix: keyboardAvoidingView enabled prop

* fix: removed unnecessary component wrapper

* feat: added the new avoidKeyboardLikeIOS prop

* fix: updated expo examples
  • Loading branch information
xxsnakerxx authored and jeremybarbet committed Jan 23, 2020
1 parent e32457a commit 7563c82
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 129 deletions.
24 changes: 24 additions & 0 deletions docs/PROPSMETHODS.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,30 @@ If you have any inputs inside your cont and you want to manage how the view shou
| ------------------------------------- | -------- |
| enum('height', 'position', 'padding') | No |

### `keyboardAvoidingOffset`

See [`react-native` documentation](https://facebook.github.io/react-native/docs/keyboardavoidingview#keyboardverticaloffset) for more informations.

| Type | Required | Default |
| -------- | -------- | -------- |
| number | No | `0` |

### `panGestureEnabled`

Using this prop will enable/disable pan gesture

| Type | Required | Default |
| -------- | -------- | -------- |
| bool | No | `true` |

### `closeOnOverlayTap`

Using this prop will enable/disable overlay tap gesture

| Type | Required | Default |
| -------- | -------- | -------- |
| bool | No | `true` |

### `withReactModal`

Define if `Modalize` has to be wrap with the Modal component from react-native.
Expand Down
2 changes: 1 addition & 1 deletion examples/expo/src/components/modals/FixedContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class FixedContent extends React.PureComponent {

render() {
return (
<Modalize ref={this.modal} adjustToContentHeight>
<Modalize ref={this.modal} adjustToContentHeight avoidKeyboardLikeIOS>
{this.renderContent()}
</Modalize>
);
Expand Down
1 change: 1 addition & 0 deletions examples/expo/src/components/modals/SimpleContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class SimpleContent extends React.PureComponent {
showsVerticalScrollIndicator: false,
stickyHeaderIndices: [0],
}}
avoidKeyboardLikeIOS
>
{this.renderContent()}
</Modalize>
Expand Down
2 changes: 1 addition & 1 deletion examples/react-native-navigation/src/screens/AlwaysOpen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
import { Modalize } from 'react-native-modalize';
import faker from 'faker';

import { Button } from '../button/Button';
import { Button } from '../components/button/Button';

export class AlwaysOpen extends React.PureComponent {
modal = React.createRef();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export class CustomStyle extends React.PureComponent {
timing: { duration: 400 },
spring: { speed: 20, bounciness: 10 },
}}
adjustToContentHeight
>
{this.renderContent()}
</Modalize>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"watch:modalize": "yarn tsc --watch",
"watch:expo": "concurrently \"yarn watch:modalize\" \"yarn cpx 'src/**/*' 'examples/expo/node_modules/react-native-modalize' --watch\"",
"watch:react-native-navigation": "concurrently \"yarn watch:modalize\" \"yarn cpx 'src/**/*' 'examples/react-native-navigation/node_modules/react-native-modalize' --watch\"",
"watch:react-navigation": "concurrently \"yarn watch:modalize\" \"yarn cpx 'src/**/*' 'examples/react-navigation/node_modules/react-native-modalize/lib' --watch\""
"watch:react-navigation": "concurrently \"yarn watch:modalize\" \"yarn cpx 'src/**/*' 'examples/react-navigation/node_modules/react-native-modalize' --watch\""
},
"keywords": [
"react-native",
Expand Down
Loading

0 comments on commit 7563c82

Please sign in to comment.