react-native-dropdownalert
Advanced tools
Comparing version 1.3.0 to 1.4.0
import React, { Component } from 'react'; | ||
import React, { Component } from 'react' | ||
import { | ||
@@ -12,3 +12,3 @@ View, | ||
Image | ||
} from "react-native"; | ||
} from "react-native" | ||
@@ -18,2 +18,12 @@ var closeTimeoutId | ||
var DropdownAlert = React.createClass({ | ||
propTypes: { | ||
closeInterval: React.PropTypes.number, | ||
backgroundColor: React.PropTypes.string, | ||
imageUri: React.PropTypes.string, | ||
imageSrc: React.PropTypes.number, | ||
textColor: React.PropTypes.string, | ||
fontFamily: React.PropTypes.string, | ||
startDelta: React.PropTypes.number, | ||
endDelta: React.PropTypes.number | ||
}, | ||
getDefaultProps: function() { | ||
@@ -24,3 +34,3 @@ return { | ||
imageUri: '', | ||
imageSrc: '', | ||
imageSrc: null, | ||
textColor: 'white', | ||
@@ -109,5 +119,4 @@ fontFamily: 'HelveticaNeue', | ||
return ( | ||
<Modal transparent={true} onRequestClose={() => this.dismiss}> | ||
<Modal animationType='fade' transparent={true} visible={this.state.visible} onRequestClose={() => this.dismiss}> | ||
<Animated.View style={{ | ||
opacity: this.state.fadeAnim, | ||
transform: [{ | ||
@@ -143,2 +152,10 @@ translateY: this.state.fadeAnim.interpolate({ | ||
alert: function(type, title, message) { | ||
if (type.length === 0 || type === null ) { | ||
console.warn('Missing DropdownAlert type. Available types: info, warn, error or custom') | ||
return | ||
} | ||
if (type != 'info' && type != 'warn' && type != 'error' && type != 'custom') { | ||
console.warn('Invalid DropdownAlert type. Available types: info, warn, error or custom') | ||
return | ||
} | ||
if (this.state.isOpen) { | ||
@@ -145,0 +162,0 @@ this.dismiss() |
{ | ||
"name": "react-native-dropdownalert", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A dropdown alert that allows you to display bits of information to your user.", | ||
@@ -5,0 +5,0 @@ "main": "DropdownAlert.js", |
### react-native-dropdownalert | ||
[![npm version](http://img.shields.io/npm/v/react-native-dropdownalert.svg?style=flat-square)](https://www.npmjs.com/package/react-native-dropdownalert "View this project on npm") | ||
[![npm version](http://img.shields.io/npm/dm/react-native-dropdownalert.svg?style=flat-square)](https://www.npmjs.com/package/react-native-dropdownalert "View this project on npm") | ||
A dropdown alert that allows you to display bits of information to your user. Try 1 of 3 types or roll your own custom type (see props below). Tap the alert to close or provide a time interval to close automatically. | ||
@@ -4,0 +7,0 @@ |
21052
245
64