diff --git a/App.js b/App.js
index bee5a0d..8a4557c 100644
--- a/App.js
+++ b/App.js
@@ -110,6 +110,18 @@ function menuPage() {
}}
/>
+
);
}
diff --git a/Apps.js b/Apps.js
index 1d5855e..3310aed 100644
--- a/Apps.js
+++ b/Apps.js
@@ -8,7 +8,7 @@ import {
} from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
-import AsyncStorage from "@react-native-async-storage/async-storage";
+import { AS } from "./storageControl";
import { news } from "./config/newsUpdate";
import { getStationList, lineList } from "./lib/getStationList";
import { StationDeteilView } from "./components/ActionSheetComponents/StationDeteilView";
@@ -53,7 +53,7 @@ export default function Apps(props) {
useEffect(() => {
//ニュース表示
- AsyncStorage.getItem("status")
+ AS.getItem("status")
.then((d) => {
if (d != news) navigate("news");
})
@@ -62,54 +62,48 @@ export default function Apps(props) {
useEffect(() => {
//列車アイコンスイッチ
- AsyncStorage.getItem("iconSwitch")
+ AS.getItem("iconSwitch")
.then((d) => {
if (d) {
setIconSetting(d);
} else {
- AsyncStorage.setItem("iconSwitch", "true").then(Updates.reloadAsync);
+ AS.setItem("iconSwitch", "true").then(Updates.reloadAsync);
}
})
- .catch((d) =>
- AsyncStorage.setItem("iconSwitch", "true").then(Updates.reloadAsync)
- );
+ .catch((d) => AS.setItem("iconSwitch", "true").then(Updates.reloadAsync));
}, []);
useEffect(() => {
//地図スイッチ
- AsyncStorage.getItem("mapSwitch")
+ AS.getItem("mapSwitch")
.then((d) => {
if (d) {
setMapSwitch(d);
} else {
- AsyncStorage.setItem("mapSwitch", "false").then(Updates.reloadAsync);
+ AS.setItem("mapSwitch", "false").then(Updates.reloadAsync);
}
})
- .catch((d) =>
- AsyncStorage.setItem("mapSwitch", "false").then(Updates.reloadAsync)
- );
+ .catch((d) => AS.setItem("mapSwitch", "false").then(Updates.reloadAsync));
}, []);
useEffect(() => {
//駅メニュースイッチ
- AsyncStorage.getItem("stationSwitch")
+ AS.getItem("stationSwitch")
.then((d) => {
if (d) {
setStationMenu(d);
} else {
- AsyncStorage.setItem("stationSwitch", "true").then(
- Updates.reloadAsync
- );
+ AS.setItem("stationSwitch", "true").then(Updates.reloadAsync);
}
})
.catch((d) =>
- AsyncStorage.setItem("stationSwitch", "true").then(Updates.reloadAsync)
+ AS.setItem("stationSwitch", "true").then(Updates.reloadAsync)
);
}, []);
const onMessage = (event) => {
if (!event.nativeEvent.data.includes("PopUpMenu")) {
- navigate("trainbase", { info: event.nativeEvent.data });
+ navigate("trainbase", { info: event.nativeEvent.data, from: "Train" });
return;
}
if (!originalStationList) {
diff --git a/components/ActionSheetComponents/JRSTraInfo.js b/components/ActionSheetComponents/JRSTraInfo.js
index 1d30174..9fb0d7e 100644
--- a/components/ActionSheetComponents/JRSTraInfo.js
+++ b/components/ActionSheetComponents/JRSTraInfo.js
@@ -22,7 +22,7 @@ export const JRSTraInfo = (props) => {
<>>}
+ CustomHeaderComponent={<>>}
>
{
<>>}
+ CustomHeaderComponent={<>>}
>
{
- AsyncStorage.setItem("status", news);
+ AS.setItem("status", news);
navigate("Apps");
}}
>
diff --git a/components/settings.js b/components/settings.js
index 7d567b0..51fc69e 100644
--- a/components/settings.js
+++ b/components/settings.js
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
import { View, Text, TouchableOpacity } from "react-native";
import * as Updates from "expo-updates";
import StatusbarDetect from "../StatusbarDetect";
-import AsyncStorage from "@react-native-async-storage/async-storage";
+import { AS } from "../storageControl";
var Status = StatusbarDetect();
import { Switch } from "react-native-elements";
@@ -14,9 +14,9 @@ export default function Setting(props) {
const [mapSwitch, setMapSwitch] = useState(undefined);
const [stationMenu, setStationMenu] = useState(undefined);
useEffect(() => {
- AsyncStorage.getItem("iconSwitch").then(setIconSetting);
- AsyncStorage.getItem("mapSwitch").then(setMapSwitch);
- AsyncStorage.getItem("stationSwitch").then(setStationMenu);
+ AS.getItem("iconSwitch").then(setIconSetting);
+ AS.getItem("mapSwitch").then(setMapSwitch);
+ AS.getItem("stationSwitch").then(setStationMenu);
}, []);
return (
@@ -102,7 +102,7 @@ export default function Setting(props) {
textAlignVertical: "center",
}}
>
- 内部バージョン: 4.4.2.6
+ 内部バージョン: 4.4.2.7
@@ -134,9 +134,9 @@ export default function Setting(props) {
}}
onPress={() => {
Promise.all([
- AsyncStorage.setItem("iconSwitch", iconSetting.toString()),
- AsyncStorage.setItem("mapSwitch", mapSwitch.toString()),
- AsyncStorage.setItem("stationSwitch", stationMenu.toString()),
+ AS.setItem("iconSwitch", iconSetting.toString()),
+ AS.setItem("mapSwitch", mapSwitch.toString()),
+ AS.setItem("stationSwitch", stationMenu.toString()),
]).then(() => {
Updates.reloadAsync();
});
diff --git a/components/trainMenu.js b/components/trainMenu.js
index 7e9f0e9..4c9d001 100644
--- a/components/trainMenu.js
+++ b/components/trainMenu.js
@@ -1,6 +1,5 @@
import React, { useRef } from "react";
import { View, Text, TouchableOpacity, Linking } from "react-native";
-import AsyncStorage from "@react-native-async-storage/async-storage";
import MapView, { Marker } from "react-native-maps";
import { MaterialCommunityIcons } from "@expo/vector-icons";
export default function trainMenu({
@@ -101,7 +100,6 @@ export default function trainMenu({
alignItems: "center",
}}
onPress={() => {
- AsyncStorage.setItem("status", "2022/04/14");
navigate("Apps");
}}
>
diff --git a/components/発車時刻表/LED_vidion.js b/components/発車時刻表/LED_vidion.js
index 3dcb4d5..ce30a62 100644
--- a/components/発車時刻表/LED_vidion.js
+++ b/components/発車時刻表/LED_vidion.js
@@ -1,10 +1,11 @@
import React, { useState, useEffect } from "react";
-import { View, Text } from "react-native";
+import { View, Text, TouchableOpacity } from "react-native";
import { Switch } from "react-native-elements";
import { widthPercentageToDP as wp } from "react-native-responsive-screen";
import { customTrainDataDetector } from "../custom-train-data";
import { useInterval } from "../../lib/useInterval";
import trainList from "../../assets/originData/trainList";
+import { objectIsEmpty } from "../../lib/objectIsEmpty";
let diagramData = undefined;
@@ -43,14 +44,27 @@ export default function LED_vision(props) {
referer: "https://train.jr-shikoku.co.jp/sp.html",
},
};
- const [trainDiagram, setTrainDiagram] = useState(null);
- const [stationDiagram, setStationDiagram] = useState(null);
- const [currentTrain, setCurrentTrain] = useState(null);
+ const [trainDiagram, setTrainDiagram] = useState(null); // 全列車のダイヤを列番ベースで整理
+ const [stationDiagram, setStationDiagram] = useState({}); //当該駅の全時刻表
+ const [currentTrain, setCurrentTrain] = useState(null); //現在在線中の全列車
const [finalSwitch, setFinalSwitch] = useState(false);
const [trainIDSwitch, setTrainIDSwitch] = useState(false);
const [trainDescriptionSwitch, setTrainDescriptionSwitch] = useState(false);
+ const parseAllTrainDiagram = (text) => {
+ const val = text.replace("[\r\n", "").split(",\r\n");
+ let trainDiagram = {};
+ val.forEach((element) => {
+ try {
+ let data = JSON.parse(element);
+ Object.keys(data).forEach((key) => (trainDiagram[key] = data[key]));
+ } catch (e) {}
+ });
+ return trainDiagram;
+ };
+
useEffect(() => {
+ //全列車リストを生成する副作用[無条件初回実行]
fetch(
"https://train.jr-shikoku.co.jp/g?arg1=station&arg2=traintimeinfo&arg3=dia",
HeaderConfig
@@ -58,56 +72,55 @@ export default function LED_vision(props) {
.then((response) => response.text())
.then((d) => {
if (d.indexOf("404 Not Found") != -1) throw Error;
- const val = d.replace("[\r\n", "").split(",\r\n");
- let trainDiagram = {};
- val.forEach((element) => {
- try {
- let data = JSON.parse(element);
- Object.keys(data).forEach((key) => (trainDiagram[key] = data[key]));
- } catch (e) {}
- });
- setTrainDiagram(trainDiagram);
- return trainDiagram;
- })
- .then((trainDiagram) => {
- let returnData = {};
- if (!trainDiagram) {
- setStationDiagram(returnData);
- return;
- }
- Object.keys(trainDiagram).forEach((key) => {
- if (trainDiagram[key].match(props.station.Station_JP)) {
- returnData[key] = trainDiagram[key];
- }
- });
- setStationDiagram(returnData);
+ setTrainDiagram(parseAllTrainDiagram(d));
})
.catch((d) => {
console.log("fallback");
setTrainDiagram(trainList);
- let returnData = {};
- if (!trainList) {
- setStationDiagram(returnData);
- return;
- }
- Object.keys(trainList).forEach((key) => {
- if (trainList[key].match(props.station.Station_JP)) {
- returnData[key] = trainList[key];
- }
- });
- setStationDiagram(returnData);
});
}, []);
- const getTime = () => {
- const returnData = [];
- Object.keys(stationDiagram).forEach((d) => {
+ useEffect(() => {
+ // 現在の駅に停車するダイヤを作成する副作用[列車ダイヤと現在駅情報]
+ if (!trainDiagram) {
+ setStationDiagram({});
+ return;
+ }
+ let returnData = {};
+ Object.keys(trainDiagram).forEach((key) => {
+ if (trainDiagram[key].match(props.station.Station_JP)) {
+ returnData[key] = trainDiagram[key];
+ }
+ });
+ setStationDiagram(returnData);
+ }, [trainDiagram, props.station]);
+
+ const getCurrentTrain = () =>
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train",
+ HeaderConfig
+ )
+ .then((response) => response.json())
+ .then((d) =>
+ d.map((x) => ({ num: x.TrainNum, delay: x.delay, Pos: x.Pos }))
+ )
+ .then(setCurrentTrain)
+ .catch((e) => {
+ console.log(e);
+ });
+
+ useEffect(getCurrentTrain, []); //初回だけ現在の全在線列車取得
+
+ useInterval(getCurrentTrain, 15000); //15秒毎に全在線列車取得
+
+ const getTime = (stationDiagram, station) => {
+ const returnData = Object.keys(stationDiagram).map((d) => {
let a = {};
stationDiagram[d].split("#").forEach((data) => {
if (data.match("着")) {
a.lastStation = data.split(",着,")[0];
}
- if (data.match(props.station.Station_JP)) {
+ if (data.match(station.Station_JP)) {
if (data.match(",発,")) {
a.time = data.split(",発,")[1];
} else {
@@ -116,9 +129,8 @@ export default function LED_vision(props) {
}
}
});
- returnData.push({ train: d, time: a.time, lastStation: a.lastStation });
+ return { train: d, time: a.time, lastStation: a.lastStation };
});
-
return returnData.sort((a, b) => {
switch (true) {
case parseInt(a.time.split(":")[0]) < parseInt(b.time.split(":")[0]):
@@ -132,23 +144,15 @@ export default function LED_vision(props) {
}
});
};
- const trainTimeAndNumber = stationDiagram != null ? getTime() : null;
- const getCurrentTrain = () =>
- fetch(
- "https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train",
- HeaderConfig
- )
- .then((response) => response.json())
- .then((d) =>
- d.map((x) => ({ num: x.TrainNum, delay: x.delay, Pos: x.Pos }))
- )
- .then(setCurrentTrain);
+
+ const [trainTimeAndNumber, setTrainTimeAndNumber] = useState(null);
useEffect(() => {
- getCurrentTrain();
- }, []);
-
- useInterval(getCurrentTrain, 15000);
+ //現在の駅に停車する列車から時刻を切り出してLEDベースにフォーマット
+ if (objectIsEmpty(stationDiagram)) return () => {};
+ const getTimeData = getTime(stationDiagram, props.station);
+ setTrainTimeAndNumber(getTimeData);
+ }, [stationDiagram]);
const timeFiltering = (d) => {
const date = new Date();
@@ -166,6 +170,135 @@ export default function LED_vision(props) {
return false;
};
+
+ const [selectedTrain, setSelectedTrain] = useState([]);
+ useEffect(() => {
+ if (!trainTimeAndNumber) return () => {};
+ if (!currentTrain) return () => {};
+ const data = trainTimeAndNumber
+ .filter((d) => currentTrain.map((m) => m.num).includes(d.train))
+ .filter(timeFiltering)
+ .filter((d) => !!finalSwitch || d.lastStation != "当駅止");
+ setSelectedTrain(data);
+ }, [trainTimeAndNumber, currentTrain, finalSwitch]);
+ return (
+
+
+ {selectedTrain.map((d, index) => (
+
+ ))}
+
+
+ );
+}
+const Header = () => (
+
+
+
+
+ 次の列車
+
+ Next Train
+
+
+
+);
+
+const Footer = ({
+ trainIDSwitch,
+ setTrainIDSwitch,
+ trainDescriptionSwitch,
+ setTrainDescriptionSwitch,
+ finalSwitch,
+ setFinalSwitch,
+}) => {
+ return (
+
+
+ 種別名 / 列番
+
+
+
+
+ 列車情報
+
+
+
+
+ 当駅止表示
+
+
+
+ );
+};
+
+const EachData = ({
+ d,
+ trainIDSwitch,
+ trainDescriptionSwitch,
+ props,
+ currentTrain,
+ customTrainDataDetector,
+ navigate,
+}) => {
const getTrainType = (data) => {
switch (data) {
case "Rapid":
@@ -178,203 +311,163 @@ export default function LED_vision(props) {
return { color: "white", name: "普通列車" };
}
};
+ const train = customTrainDataDetector(d.train);
return (
-
-
+ {
+ if (train.type != "Normal") {
+ navigate("trainbase", {
+ info: "train.html?tn=" + d.train,
+ from: "LED",
+ });
+ }
+ }}
>
-
-
-
- 次の列車
-
- Next Train
-
-
-
- {trainTimeAndNumber
- ? currentTrain &&
- trainTimeAndNumber
- .filter((d) => currentTrain.map((m) => m.num).includes(d.train))
- .filter(timeFiltering)
- .filter((d) => !!finalSwitch || d.lastStation != "当駅止")
- .map((d, index) => {
- const train = customTrainDataDetector(d.train);
- return [
-
-
- 6 ? 15 : 20,
- color: getTrainType(train.type).color,
- fontWeight: "bold",
- }}
- >
- {trainIDSwitch
- ? d.train
- : getTrainType(train.type).name +
- " " +
- train.trainName +
- (train.trainNumDistance == undefined
- ? ""
- : parseInt(
- d.train.replace("M", "").replace("D", "")
- ) -
- train.trainNumDistance +
- "号")}
-
-
-
- 4 ? 15 : 20,
- color: "white",
- fontWeight: "bold",
- }}
- >
- {d.lastStation}
-
-
-
-
- {d.time}
-
-
-
-
- {(() => {
- const current = currentTrain.filter(
- (a) => a.num == d.train
- )[0];
- const delay = current.delay;
- switch (true) {
- case delay == "入線":
- if (current.Pos == props.station.Station_JP) {
- return "当駅始発";
- } else {
- return "発車前";
- }
-
- case isNaN(delay):
- return delay;
- case delay == 0:
- return "定刻通り";
- default:
- return delay + "分遅れ";
- }
- })()}
-
-
- ,
- trainDescriptionSwitch && !!train.info && (
-
-
-
- {" "}
- > {train.info}
-
-
-
- ),
- ];
- })
- : null}
-
-
- 種別名 / 列番
-
-
-
-
- 列車情報
-
-
-
+
+
+
+
+ {trainDescriptionSwitch && !!train.info && }
+ >
+ );
+};
+
+const TrainName = ({ train, trainIDSwitch, d, getTrainType }) => {
+ const { trainName, trainNumDistance } = train;
+ let TrainNumber = "";
+ if (trainNumDistance != undefined) {
+ const timeInfo =
+ parseInt(d.train.replace("M", "").replace("D", "")) - trainNumDistance;
+ TrainNumber = timeInfo + "号";
+ }
+ return (
+
+ 6 ? 15 : 20,
+ color: getTrainType.color,
+ fontWeight: "bold",
+ }}
+ >
+ {trainIDSwitch
+ ? d.train
+ : `${getTrainType.name} ${trainName}${TrainNumber}`}
+
+
+ );
+};
+
+const LastStation = ({ d }) => {
+ return (
+
+ 4 ? 15 : 20,
+ color: "white",
+ fontWeight: "bold",
+ }}
+ >
+ {d.lastStation}
+
+
+ );
+};
+const DependTime = ({ d }) => {
+ return (
+
+
+ {d.time}
+
+
+ );
+};
+
+const StatusAndDelay = ({ currentTrain, d, props }) => {
+ const [status, setStatus] = useState("");
+ useEffect(() => {
+ const current = currentTrain.filter((a) => a.num == d.train)[0];
+ const delay = current.delay;
+ switch (true) {
+ case delay === "入線":
+ if (current.Pos === props.station.Station_JP) {
+ setStatus("当駅始発");
+ break;
+ } else {
+ setStatus("発車前");
+ break;
+ }
+ case isNaN(delay):
+ setStatus(delay);
+ break;
+ case delay === 0:
+ setStatus("定刻通り");
+ break;
+ default:
+ setStatus(delay + "分遅れ");
+ break;
+ }
+ }, []);
+ return (
+
+
+ {status}
+
+
+ );
+};
+const Description = ({ train }) => {
+ return (
+
+
- 当駅止表示
+ {" "}
+ > {train.info}
-
);
-}
+};
diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js
index 626c7fa..4cc7135 100644
--- a/components/駅名表/Sign.js
+++ b/components/駅名表/Sign.js
@@ -16,6 +16,31 @@ import { useInterval } from "../../lib/useInterval";
export default function Sign(props) {
const { currentStation, originalStationList, oP } = props;
+ const [nexPrePosition, setNexPrePosition] = useState(0);
+
+ const [preStation, setPreStation] = useState();
+ const [nexStation, setNexStation] = useState();
+
+ useInterval(() => {
+ if (currentStation.length == 1) {
+ setNexPrePosition(0);
+ return () => {};
+ }
+ LayoutAnimation.easeInEaseOut();
+ setNexPrePosition(
+ nexPrePosition + 1 == currentStation.length ? 0 : nexPrePosition + 1
+ );
+ }, 2000);
+
+ useEffect(() => {
+ setNexPrePosition(0);
+ getPreNextStation(currentStation[0]);
+ }, [currentStation]);
+
+ useEffect(() => {
+ if (!currentStation[nexPrePosition]) return () => {};
+ getPreNextStation(currentStation[nexPrePosition]);
+ }, [nexPrePosition]);
const getPreNextStation = (now) => {
const lineList = [
"予讃線",
@@ -40,16 +65,9 @@ export default function Sign(props) {
];
}
});
- return returnData;
+ setPreStation(returnData[0]);
+ setNexStation(returnData[1]);
};
- const [nexPrePosition, setNexPrePosition] = useState(0);
- useInterval(() => {
- if (currentStation.length == 1) return;
- LayoutAnimation.easeInEaseOut();
- setNexPrePosition(
- nexPrePosition + 1 == currentStation.length ? 0 : nexPrePosition + 1
- );
- }, 2000);
return (
@@ -57,84 +75,80 @@ export default function Sign(props) {
JR
- {(() => {
- let [preStation, nexStation] = getPreNextStation(
- currentStation[nexPrePosition]
- );
- return (
-
-
- {preStation && (
- <>
- ◀
- {preStation.StationNumber && (
-
-
-
- {preStation.StationNumber}
-
-
-
- )}
-
- >
- )}
-
-
- {nexStation && (
- <>
-
- {nexStation.StationNumber && (
-
-
-
- {nexStation.StationNumber}
-
-
-
- )}
- ▶
- >
- )}
-
-
- );
- })()}
+
);
}
+const NexPreStationLine = ({ nexStation, preStation }) => {
+ return (
+
+
+ {preStation && (
+ <>
+ ◀
+ {preStation.StationNumber && (
+
+
+
+ {preStation.StationNumber}
+
+
+
+ )}
+
+ >
+ )}
+
+
+ {nexStation && (
+ <>
+
+ {nexStation.StationNumber && (
+
+
+
+ {nexStation.StationNumber}
+
+
+
+ )}
+ ▶
+ >
+ )}
+
+
+ );
+};
+
const StationNumberMaker = (props) => {
+ const getTop = (array, index) => {
+ if (array.length == 1) return 20;
+ else if (index == 0) return 5;
+ else if (index == 1) return 35;
+ else return 20;
+ };
return props.currentStation
.filter((d) => (d.StationNumber ? true : false))
.map((d, index, array) => (
{
- if (array.length == 1) return 20;
- else if (index == 0) return 5;
- else if (index == 1) return 35;
- else return 20;
- })() + "%",
+ top: getTop(array, index) + "%",
right: "10%",
width: wp("10%"),
height: wp("10%"),
diff --git a/lib/objectIsEmpty.js b/lib/objectIsEmpty.js
new file mode 100644
index 0000000..6b25d53
--- /dev/null
+++ b/lib/objectIsEmpty.js
@@ -0,0 +1,3 @@
+export const objectIsEmpty = (obj) => {
+ return !Object.keys(obj).length;
+};
diff --git a/menu.js b/menu.js
index ab8cb5e..32cc2cf 100644
--- a/menu.js
+++ b/menu.js
@@ -97,7 +97,7 @@ export default function Menu(props) {
pre.push(...current);
return pre;
}, []);
- LayoutAnimation.spring();
+ LayoutAnimation.easeInEaseOut();
if (returnDataBase.length) {
let currentStation = currentStation == undefined ? [] : currentStation;
if (currentStation.toString() != returnDataBase.toString()) {
@@ -160,7 +160,7 @@ export default function Menu(props) {
originalStationList={originalStationList}
oP={StationBoardAcSR.current?.setModalVisible}
/>
-
+
>
)}
{
delayData.map((d, index) => {
let data = d.split(" ");
return (
-
+
{data[0].replace("\n", "")}
diff --git a/storageConfig.js b/storageConfig.js
new file mode 100644
index 0000000..8b1c3a0
--- /dev/null
+++ b/storageConfig.js
@@ -0,0 +1,27 @@
+import Storage from "react-native-storage";
+import AsyncStorage from "@react-native-async-storage/async-storage";
+
+const storage = new Storage({
+ // maximum capacity, default 1000 key-ids
+ size: 10000,
+
+ // Use AsyncStorage for RN apps, or window.localStorage for web apps.
+ // If storageBackend is not set, data will be lost after reload.
+ storageBackend: AsyncStorage, // for web: window.localStorage
+
+ // expire time, default: 1 day (1000 * 3600 * 24 milliseconds).
+ // can be null, which means never expire.
+ defaultExpires: null,
+
+ // cache data in the memory. default is true.
+ enableCache: true,
+
+ // if data was not found in storage or expired data was found,
+ // the corresponding sync method will be invoked returning
+ // the latest data.
+ sync: {
+ // we'll talk about the details later.
+ },
+});
+
+export default storage;
diff --git a/storageControl.js b/storageControl.js
new file mode 100644
index 0000000..4f43140
--- /dev/null
+++ b/storageControl.js
@@ -0,0 +1,14 @@
+import storage from "./storageConfig.js";
+
+export const AS = {
+ getItem: (key) => storage.load({ key }),
+ setItem: (key, data) =>
+ storage.save({
+ key, // Note: Do not use underscore("_") in key!
+ data,
+
+ // if expires not specified, the defaultExpires will be applied instead.
+ // if set to null, then it will never expire.
+ expires: null,
+ }),
+};
diff --git a/trainbaseview.js b/trainbaseview.js
index 1e02f35..793bf9d 100644
--- a/trainbaseview.js
+++ b/trainbaseview.js
@@ -1,9 +1,18 @@
import React, { Component, useRef } from "react";
-import { StatusBar, Platform, View } from "react-native";
+import {
+ StatusBar,
+ Platform,
+ View,
+ TouchableOpacity,
+ Text,
+} from "react-native";
import { WebView } from "react-native-webview";
+import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
-export default function TrainBase({ route }) {
- const { info } = route.params;
+export default function TrainBase({ route, navigation }) {
+ const { info, from } = route.params;
+ const { navigate } = navigation;
+ console.log(info);
const webview = useRef();
const jss = `document.getElementById('Footer').style.display = 'none';
${
@@ -28,6 +37,27 @@ export default function TrainBase({ route }) {
setSupportMultipleWindows={false}
onMessage={(event) => {}}
/>
+ {from == "LED" && (
+ navigate("menu")}
+ >
+
+
+
+ 閉じる
+
+
+
+ )}
);
}