Skip to content

Commit a14182f

Browse files
author
罗瑞东
committed
fix(index):iimprove something
1 parent 4ad8f01 commit a14182f

6 files changed

Lines changed: 7 additions & 18 deletions

File tree

index.android.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

index.ios.js renamed to index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {NativeModules} from 'react-native';
1+
import {NativeModules,ToastAndroid,Platform} from 'react-native';
22

3-
var RCTToastModule = NativeModules.LRDRCTSimpleToast;
3+
var RCTToastModule = Platform.OS === 'android' ? ToastAndroid : NativeModules.LRDRCTSimpleToast;
44

55
var SimpleToast = {
66
SHORT: RCTToastModule.SHORT,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-simple-toast",
3-
"version": "0.0.1",
4-
"description": "simple toast for react-native. In Android it's just native toast, in iOS it's https://github.com/scalessec/Toast",
3+
"version": "0.0.2",
4+
"description": "Simple Toast for react-native. In Android it's just native toast, in iOS it's https://github.com/scalessec/Toast",
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"

sample/index.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Text,
1313
View
1414
} from 'react-native';
15-
import Toast from './node_modules/react-native-simple-toast/index.android';
15+
import Toast from 'react-native-simple-toast';
1616
class samples extends Component {
1717
render() {
1818
return (

sample/index.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Text,
1313
View
1414
} from 'react-native';
15-
import Toast from './node_modules/react-native-simple-toast/index.ios';
15+
import Toast from 'react-native-simple-toast';
1616
class samples extends Component {
1717
render() {
1818
return (

sample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"dependencies": {
99
"react": "15.1.0",
1010
"react-native": "^0.28.0",
11-
"react-native-simple-toast": "latest"
11+
"react-native-simple-toast": "0.0.2"
1212
}
1313
}

0 commit comments

Comments
 (0)