# react-native-dialog-layer

> [![Download](https://img.shields.io/badge/Download-v1.0.2-ff69b4.svg) ](https://www.npmjs.com/package/react-native-dialog-layer) [![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](https://github.com/SNY7/react-native-dialog-layer/p

Latest version **1.0.2** (published 2018-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-dialog-layer
pnpm add react-native-dialog-layer
yarn add react-native-dialog-layer
bun add react-native-dialog-layer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-05-17 |
| First published | 2018-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Henry Young |
| Maintainers | sny7 |
| Keywords | react-native, dialog, confirm, alert, mobx |

## Links

- npm: https://www.npmjs.com/package/react-native-dialog-layer
- Repository: https://github.com/SNY7/react-native-dialog-layer
- npm.io page: https://npm.io/package/react-native-dialog-layer

## Dependencies (1)

- [react-native-simple-dialogs](https://npm.io/package/react-native-simple-dialogs.md) ^0.3.1

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-05-17
- 1.0.1 — 2018-05-17
- 1.0.0 — 2018-05-17

## README

# react-native-dialog-layer

[![Download](https://img.shields.io/badge/Download-v1.0.2-ff69b4.svg) ](https://www.npmjs.com/package/react-native-dialog-layer)
[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](https://github.com/SNY7/react-native-dialog-layer/pulls)

A easy to use react native dialog layer, with queue support, based on `mobx`, `react-native-simple-dialogs`.

## INSTALLATION:

```shell
yarn add react-native-dialog-layer
OR
npm install --save react-native-dialog-layer
```

You also need to install mobx dependencies:

```shell
yarn add mobx mobx-react
OR
npm install --save mobx mobx-react
```

## PREPARING

Modify your codes like this:
    
```js
...
import { DialogLayer, dialogLayerStore } from 'react-native-dialog-layer';
...

class AppComponent extends React.Component {
  render() {
    <View style={{ flex: 1, backgroundColor: 'white' }}>
      ...
      <DialogLayer />
      ...
    </View>
  }
}

const App = () => (
  <Provider {...yourOtherMobxStores} dialogLayerStore={dialogLayerStore}>
    <AppComponent />
  </Provider>
);
```

## BASIC USAGE

1. Import dialogLayerStore in your js files:

    ```js
    import { dialogLayerStore } from 'react-native-dialog-layer';
    ```

2. Add a dialog into the queue:

    ```js
    dialogLayerStore.add(
      'Some APP',
      'Do you want to exit?',
      [
        { text: 'EXIT', onPress: () => { BackHandler.exitApp(); } },
        { text: 'CANCEL', onPress: () => { dialogLayerStore.shift(); } },
      ],
    );
    ```

The first dialog in the queue will show up.

## API

Method            | Description
----------------- | -----------
dialogLayerStore.add() | Add a dialog into the queue (See the example above)
dialogLayerStore.shift() | Close current dialog

## Contribution

Issues are welcome. Please add a screenshot of you bug and a code snippet. Quickest way to solve issue is to reproduce it in one of the examples.

Pull requests are welcome. If you want to change the API or do something big it is best to create an issue and discuss it first.

---

**MIT Licensed**

---
_Source: https://npm.io/package/react-native-dialog-layer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
