広域列車運行情報を試験実装
This commit is contained in:
parent
d47191761a
commit
831b632e7d
13
App.js
13
App.js
@ -6,7 +6,7 @@ import {
|
||||
} from "@react-navigation/stack";
|
||||
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
||||
import { AntDesign, Ionicons } from "@expo/vector-icons";
|
||||
import { Platform, UIManager } from "react-native";
|
||||
import { Platform, UIManager, Text } from "react-native";
|
||||
import { UpdateAsync } from "./UpdateAsync.js";
|
||||
import { getStationList2 } from "./lib/getStationList2";
|
||||
import { AS } from "./storageControl";
|
||||
@ -91,8 +91,19 @@ export default function App() {
|
||||
|
||||
useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得
|
||||
|
||||
const [areaInfo, setAreaInfo] = useState();
|
||||
const getAreaInfo = () => {
|
||||
fetch(
|
||||
"https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec"
|
||||
)
|
||||
.then((d) => d.text())
|
||||
.then((d) => setAreaInfo(d));
|
||||
};
|
||||
useEffect(getAreaInfo, []);
|
||||
|
||||
return (
|
||||
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
||||
<Text onPress={() => alert(areaInfo)}>{areaInfo}</Text>
|
||||
<Tab.Navigator detachInactiveScreens={false}>
|
||||
<Tab.Screen
|
||||
name="login"
|
||||
|
Loading…
Reference in New Issue
Block a user