diff --git a/App.js b/App.js index d496cf9..97a3f19 100644 --- a/App.js +++ b/App.js @@ -105,13 +105,14 @@ export function AppContainer() { useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得 const { areaInfo, setAreaInfo } = useAreaInfo(); - useEffect(() => { + const getAreaData = () => fetch( "https://script.google.com/macros/s/AKfycbz80LcaEUrhnlEsLkJy0LG2IRO3DBVQhfNmN1d_0f_HvtsujNQpxM90SrV9yKWH_JG1Ww/exec" ) .then((d) => d.text()) .then((d) => setAreaInfo(d)); - }, []); + useEffect(getAreaData, []); + useInterval(getAreaData, 60000); //60秒毎に全在線列車取得 return ( diff --git a/components/発車時刻表/LED_vidion.js b/components/発車時刻表/LED_vidion.js index 37b2d76..140dc8c 100644 --- a/components/発車時刻表/LED_vidion.js +++ b/components/発車時刻表/LED_vidion.js @@ -199,6 +199,7 @@ export default function LED_vision(props) { alert(areaInfo)} /> )} @@ -438,8 +439,8 @@ const StatusAndDelay = ({ trainDelayStatus }) => { ); }; -const Description = ({ info, numberOfLines = 0 }) => ( - ( + ( backgroundColor: "#000", flexDirection: "row", }} + onPress={onClick} > ( > {info} - + ); diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index 2d4dd84..c3381a2 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -235,6 +235,7 @@ const StationNumberMaker = (props) => { borderWidth: parseInt("2%"), borderRadius: parseInt("100%"), }} + key={array[index].StationNumber} > {d.StationNumber} diff --git a/ndView.js b/ndView.js index fd58f58..0010ba7 100644 --- a/ndView.js +++ b/ndView.js @@ -1,8 +1,11 @@ -import React from "react"; -import { View, Platform } from "react-native"; +import React, { useRef, useState } from "react"; +import { View, Platform, TouchableOpacity } from "react-native"; import { WebView } from "react-native-webview"; import Constants from "expo-constants"; +import { Ionicons } from "@expo/vector-icons"; export default function tndView() { + const webview = useRef(); + const [LoadError, setLoadError] = useState(false); return ( + webview.current.reload()} + top={Platform.OS == "ios" ? Constants.statusBarHeight : 0} + LoadError={LoadError} + /> ); } @@ -31,3 +40,39 @@ const jsa = ` document.querySelector('.sitettl').style.display = 'none'; document.querySelector('.attention').style.display = 'none'; `; + +const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => { + const styles = { + touch: { + position: "absolute", + top, + right: 10, + width: 50, + height: 50, + backgroundColor: LoadError ? "red" : "#0099CC", + borderColor: "white", + borderStyle: "solid", + borderWidth: 1, + borderRadius: 50, + alignContent: "center", + alignSelf: "center", + alignItems: "center", + display: mapSwitch, + }, + text: { + textAlign: "center", + width: "auto", + height: "auto", + textAlignVertical: "center", + fontWeight: "bold", + color: "white", + }, + }; + return ( + + + + + + ); +};