Skip to content

Commit 9fca926

Browse files
crazycodeboy午天
authored andcommitted
publish v1.0.8
1 parent c88e68f commit 9fca926

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

131131
Toast.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

145145
Toast.defaultProps = {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-easy-toast",
3-
"version": "1.0.6",
3+
"version": "1.0.8",
44
"description": "A react native module to show toast like android, it works on iOS and Android.",
55
"main": "index.js",
66
"scripts": {
@@ -28,7 +28,8 @@
2828
"url": "https://github.com/crazycodeboy/react-native-easy-toast/issues"
2929
},
3030
"peerDependencies": {
31-
"react-native": ">=0.20.0"
31+
"react-native": ">=0.20.0",
32+
"prop-types": "^15.5.7"
3233
},
3334
"homepage": "https://github.com/crazycodeboy/react-native-easy-toast#readme"
3435
}

0 commit comments

Comments
 (0)