Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add react modal props to Modalize #352

Merged
merged 3 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ Define if `Modalize` has to be wrap with the Modal component from react-native.
| ---- | -------- | ------- |
| bool | No | `false` |

### `reactModalProps`

Props for the react-native `Modal` wrapping `Modalize`.

| Type | Required |
| ---------- | -------- |
| ModalProps | No |

### `withHandle`

Define if the handle on top of the modal is display or not.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-modalize",
"version": "2.0.8",
"version": "2.0.9",
"description": "A highly customizable modal/bottom sheet that loves scrolling content.",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const ModalizeBase = (

// Elements visibilities
withReactModal = false,
reactModalProps,
withHandle = true,
withOverlay = true,

Expand Down Expand Up @@ -951,6 +952,7 @@ const ModalizeBase = (

const renderReactModal = (child: JSX.Element): JSX.Element => (
<Modal
{...reactModalProps}
supportedOrientations={['landscape', 'portrait', 'portrait-upside-down']}
onRequestClose={handleBackPress}
hardwareAccelerated={USE_NATIVE_DRIVER}
Expand Down
6 changes: 6 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
FlatList,
SectionList,
StyleProp,
ModalProps,
} from 'react-native';

export type TOpen = 'default' | 'top';
Expand Down Expand Up @@ -237,6 +238,11 @@ export interface IProps<ListItem = any> {
*/
withReactModal?: boolean;

/**
* Props for the react-native Modal wrapping Modalize
*/
reactModalProps: ModalProps;

/**
* Define if the handle on top of the modal is display or not.
* @default true
Expand Down