1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 21:10:40 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

chore: some tweak

This commit is contained in:
sunnylqm
2023-02-20 13:03:12 +08:00
parent 55879198e8
commit d6c268f533
7 changed files with 68 additions and 57 deletions

View File

@@ -1,21 +1,23 @@
import React from 'react';
/* eslint-disable react-native/no-inline-styles */
/* eslint-disable react/react-in-jsx-scope */
import {useState} from 'react';
import {
ActivityIndicator,
Alert,
Modal,
TextInput,
Button,
NativeModules,
StyleSheet,
SafeAreaView,
Text,
View,
} from 'react-native';
const Pushy = NativeModules.Pushy;
import {PushyModule} from 'react-native-update';
export default function TestConsole({visible}) {
const [text, setText] = React.useState('');
const [running, setRunning] = React.useState(false);
const [text, setText] = useState('');
const [running, setRunning] = useState(false);
return (
<Modal visible={visible}>
<SafeAreaView style={{flex: 1, padding: 10}}>
@@ -47,7 +49,7 @@ export default function TestConsole({visible}) {
const methodName = inputs[0];
let params;
if (inputs.length === 1) {
await Pushy[methodName]();
await PushyModule[methodName]();
} else {
if (inputs.length === 2) {
params = inputs[1];
@@ -58,7 +60,7 @@ export default function TestConsole({visible}) {
}
console.log({inputs, params});
}
await Pushy[methodName](params);
await PushyModule[methodName](params);
}
Alert.alert('done');
} catch (e) {