コード整理
This commit is contained in:
@@ -4,6 +4,25 @@ import {
|
||||
TextWidget,
|
||||
ListWidget,
|
||||
} from "react-native-android-widget";
|
||||
import dayjs from "dayjs";
|
||||
import { ToastAndroid } from "react-native";
|
||||
|
||||
export const getInfoString = async () => {
|
||||
// Fetch data from the server
|
||||
const time = dayjs().format("HH:mm");
|
||||
const text = await fetch(
|
||||
"https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec"
|
||||
)
|
||||
.then((response) => response.text())
|
||||
.then((data) => {
|
||||
if (data !== "") {
|
||||
return data.split("^");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
ToastAndroid.show(`${text}`, ToastAndroid.SHORT);
|
||||
return { time, text };
|
||||
};
|
||||
|
||||
export function InfoWidget({ time, text }) {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user