1.1.2 • Published 4 years ago

rn-modal-window v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

rn-modal-window

version downloads

Prerequisites

This library is pure react-native component, so just have fun on it

Installation

To install this component to your react-native project, please just following this instruction bellow.

#on your root project, enter command
$ npm install --save rn-modal-window

Example code

To install this component to your react-native project, please just following this instruction bellow.

import React, {Component} from 'react';
import {Text, View} from 'react-native';
import ModalWindow from "rn-modal-window";

export default class App extends Component<Props> {
  componentDidmount = () => {
    this.modalExample.show()
  }
  closeModalExample = () => {
    this.modalExample.dismiss();
  }
  render() {
    return (
      <ModalWindow title = { 'your moadl title' } ref = { ref => this.modalExample = ref }       actionRender = {() => (
        <TouchableOpacity onPress = { this.closeModalExample }>
          <Text>Close</Text>
        </TouchableOpacity>
      )} width = {"90%"} >
        <Text>example modal</Text>
      </ModalWindow>
    );
  }
}

defaultProps

So you can add many properties, you can look at the list of defaultprops / properties

// Propeties 

ModalWindow.defaultProps = {
  actionRender: undefined,
  width: '90%',
  height: modularHeight(.6),
  isShow: false,
  onDismiss: () => null, // only ios
  headerStyle: {},
  headerBtn: () => null,
  headerTitleStyle: {}
}

Dependencies

no depedencies, its all use eact-native component

License

MIT Licences