@@ -14,9 +14,9 @@ import {
1414 Dimensions ,
1515 Text ,
1616} from 'react-native'
17-
18- export const DURATION = {
19- LENGTH_LONG : 2000 ,
17+ import { PropTypes } from 'prop-types' ;
18+ export const DURATION = {
19+ LENGTH_LONG : 2000 ,
2020 LENGTH_SHORT : 500 ,
2121 FOREVER : 0 ,
2222} ;
@@ -95,15 +95,15 @@ export default class Toast extends Component {
9595 pos = height - this . props . positionValue ;
9696 break ;
9797 }
98-
98+
9999 const view = this . state . isShow ?
100100 < View
101101 style = { [ styles . container , { top : pos } ] }
102102 pointerEvents = "none"
103- >
103+ >
104104 < Animated . View
105105 style = { [ styles . content , { opacity : this . state . opacityValue } , this . props . style ] }
106- >
106+ >
107107 < Text style = { this . props . textStyle } > { this . state . text } </ Text >
108108 </ Animated . View >
109109 </ View > : null ;
@@ -130,16 +130,16 @@ const styles = StyleSheet.create({
130130
131131Toast . propTypes = {
132132 style : View . propTypes . style ,
133- position : React . PropTypes . oneOf ( [
133+ position :PropTypes . oneOf ( [
134134 'top' ,
135135 'center' ,
136136 'bottom' ,
137137 ] ) ,
138138 textStyle : Text . propTypes . style ,
139- positionValue : React . PropTypes . number ,
140- fadeInDuration : React . PropTypes . number ,
141- fadeOutDuration : React . PropTypes . number ,
142- opacity : React . PropTypes . number
139+ positionValue :PropTypes . number ,
140+ fadeInDuration :PropTypes . number ,
141+ fadeOutDuration :PropTypes . number ,
142+ opacity :PropTypes . number
143143}
144144
145145Toast . defaultProps = {
0 commit comments