From 305d386fcc2c7cb3dff9a7aee9165df702f67b9e Mon Sep 17 00:00:00 2001 From: harukin-OneMix4 Date: Sat, 23 Dec 2023 03:12:02 +0900 Subject: [PATCH] =?UTF-8?q?=E9=81=8B=E8=A1=8C=E6=83=85=E5=A0=B1=E3=82=92?= =?UTF-8?q?=E5=AE=9A=E6=99=82=E6=9B=B4=E6=96=B0=E5=8C=96=E3=80=81LED?= =?UTF-8?q?=E3=81=A7=E3=83=9D=E3=83=83=E3=83=97=E3=82=A2=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=82=92=E5=87=BA=E3=81=9B=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 5 ++- components/発車時刻表/LED_vidion.js | 8 ++-- components/駅名表/Sign.js | 1 + ndView.js | 49 +++++++++++++++++++++++- 4 files changed, 56 insertions(+), 7 deletions(-) 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 ( + + + + + + ); +};