Skip to content

Commit

Permalink
feat: add rootStyle props (#187)
Browse files Browse the repository at this point in the history
* feat: zIndex property

* fix: replace zIndex property to rootStyle for more customization

* fix: remove zIndex type property

* fix: remove modalElevation property
  • Loading branch information
enniel authored May 4, 2020
1 parent 2ebf106 commit 149af45
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ An animated custom React node that will inherit of the onScroll/gesture events

Multiple objects way to style the different part of Modalize.

### `rootStyle`

Define the style of the root modal component.

| Type | Required |
| ----- | -------- |
| style | No |

### `modalStyle`

Define the style of the modal (includes handle/header/children/footer).
Expand Down Expand Up @@ -178,14 +186,6 @@ Define the style of the children renderer (only the inside part).
| ----- | -------- |
| style | No |

### `modalElevation`

A number to define the elevation of the modal on Android. Useful if you have other elements of your app using other values of elevation.

| Type | Required | Platform |
| ------ | -------- | -------- |
| number | No | Android |

## Layout

### `snapPoint`
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const ModalizeBase = (
customRenderer,

// Styles
rootStyle,
modalStyle,
handleStyle,
overlayStyle,
childrenStyle,
modalElevation,

// Layout
snapPoint,
Expand Down Expand Up @@ -814,7 +814,7 @@ const ModalizeBase = (

const renderModalize = (
<View
style={[s.modalize, { elevation: modalElevation }]}
style={[s.modalize, rootStyle]}
pointerEvents={alwaysOpen || !withOverlay ? 'box-none' : 'auto'}
>
<TapGestureHandler
Expand Down
10 changes: 5 additions & 5 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export interface IProps<ListItem = any> {
*/
customRenderer?: JSX.Element;

/**
* Define the style of the root modal component.
*/
rootStyle?: TStyle;

/**
* Define the style of the modal (includes handle/header/children/footer).
*/
Expand All @@ -94,11 +99,6 @@ export interface IProps<ListItem = any> {
*/
childrenStyle?: TStyle;

/**
* A number to define the elevation of the modal on Android. Useful if you have other elements of your app using other values of elevation (Android specific).
*/
modalElevation?: number;

/**
* A number that will enable the snapping feature and create an intermediate point before opening the modal to full screen.
*/
Expand Down

0 comments on commit 149af45

Please sign in to comment.