diff --git a/components/ActionSheetComponents/EachTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo.js
index 0c961c5..829d91a 100644
--- a/components/ActionSheetComponents/EachTrainInfo.js
+++ b/components/ActionSheetComponents/EachTrainInfo.js
@@ -21,13 +21,15 @@ import {
heightPercentageToDP,
widthPercentageToDP,
} from "react-native-responsive-screen";
-import lineColorList from "../../assets/originData/lineColorList";
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
import { checkDuplicateTrainData } from "../../lib/checkDuplicateTrainData";
import dayjs from "dayjs";
import { getTrainType } from "../../lib/getTrainType";
import { customTrainDataDetector } from "../custom-train-data";
import { useBusAndTrainData } from "../../stateBox/useBusAndTrainData";
+import { EachStopList } from "./EachTrainInfo/EachStopList";
+import { DataFromButton } from "./EachTrainInfo/DataFromButton";
+import { TrainDataView } from "./EachTrainInfo/TrainDataView";
export const EachTrainInfo = (props) => {
if (!props.payload) return <>>;
@@ -647,7 +649,7 @@ export const EachTrainInfo = (props) => {
i.split(",")[1] == "提" ? (
) : (
- {
);
};
-
-const DataFromButton = ({ i }) => {
- const [station, se, time] = i.split(",");
- return (
- Linking.openURL(time)}
- key={station}
- >
-
-
- {station}
-
-
- 提供元
-
-
-
-
-
- );
-};
-
-const StationButton = ({
- i,
- index,
- stationList,
- points,
- currentTrainData,
- openStationACFromEachTrainInfo,
-}) => {
- const [station, se, time] = i.split(","); // 阿波池田,発,6:21
- const Stations = stationList
- .map((a) => a.filter((d) => d.StationName == station))
- .reduce((newArray, e) => newArray.concat(e), []);
- /*Array [
- Object {
- "StationName": "佐古",
- "StationNumber": "T01",
- },
- Object {
- "StationName": "佐古",
- "StationNumber": "B01",
- },
- ] */
- const StationNumbers =
- Stations &&
- Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
- // Array [ "T01", "B01",]
- const lineIDs = [];
- const EachIDs = [];
- StationNumbers.forEach((d) => {
- const textArray = d.split("");
- lineIDs.push(textArray.filter((s) => "A" < s && s < "Z").join(""));
- EachIDs.push(textArray.filter((s) => "0" <= s && s <= "9").join(""));
- });
- // Array [ "T", "B",]
- // Array [ "01", "01",]
-
- const dates = dayjs()
- .set("hour", parseInt(time.split(":")[0]))
- .set("minute", parseInt(time.split(":")[1]))
- .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
- const timeString = dates.format("HH:mm").split(":");
-
- return (
- openStationACFromEachTrainInfo(station)}
- key={station}
- >
-
-
- {lineIDs.map((lineID, index) => (
-
-
-
- {lineIDs[index]}
- {"\n"}
- {EachIDs[index]}
-
-
-
- ))}
-
-
- {station}
-
- {points && points.findIndex((d) => d == index) >= 0 ? (
- 🚊
- ) : null}
- {!isNaN(currentTrainData?.delay) && currentTrainData?.delay != 0 && (
-
- {time}
-
- )}
-
- {timeString[0]}:{timeString[1]}
-
-
- {se?.replace("発", "出発").replace("着", "到着")}
-
-
-
-
- );
-};
-
-const TrainDataView = ({
- currentTrainData,
- currentPosition,
- nearTrainIDList,
- openTrainInfo,
-}) => {
- return (
-
-
-
-
-
-
- {
- if (nearTrainIDList.length == 0) return;
- openTrainInfo(nearTrainIDList[0]);
- }}
- >
- {nearTrainIDList.length == 0 ? (
-
- ) : (
-
- )}
-
-
-
- );
-};
-
-const StateBox = ({ text, title, style }) => (
-
- {title}
-
-
- {text?.match("~") ? (
- <>
- {text.split("~")[0]}
- ~
- {text.split("~")[1]}
- >
- ) : (
- {text}
- )}
-
-
-);
-const boxStyle = {
- flex: 1,
- backgroundColor: "white",
- borderRadius: 10,
- padding: 10,
- margin: 10,
-};
-const boxTextStyle = {
- fontSize: 25,
- color: "#0099CC",
- textAlign: "right",
-};
diff --git a/components/ActionSheetComponents/EachTrainInfo/DataFromButton.js b/components/ActionSheetComponents/EachTrainInfo/DataFromButton.js
new file mode 100644
index 0000000..664a8bf
--- /dev/null
+++ b/components/ActionSheetComponents/EachTrainInfo/DataFromButton.js
@@ -0,0 +1,36 @@
+import React from "react";
+import { View, Text, TouchableWithoutFeedback } from "react-native";
+import { MaterialCommunityIcons } from "@expo/vector-icons";
+import { Linking } from "react-native";
+export const DataFromButton = ({ i }) => {
+ const [station, se, time] = i.split(",");
+ return (
+ Linking.openURL(time)}
+ key={station}
+ >
+
+
+ {station}
+
+
+ 提供元
+
+
+
+
+
+ );
+};
diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js
new file mode 100644
index 0000000..218a025
--- /dev/null
+++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js
@@ -0,0 +1,137 @@
+import React from "react";
+import { View, Text, TouchableWithoutFeedback } from "react-native";
+import dayjs from "dayjs";
+import lineColorList from "../../../assets/originData/lineColorList";
+
+export const EachStopList = ({
+ i,
+ index,
+ stationList,
+ points,
+ currentTrainData,
+ openStationACFromEachTrainInfo,
+}) => {
+ const [station, se, time] = i.split(","); // 阿波池田,発,6:21
+ const Stations = stationList
+ .map((a) => a.filter((d) => d.StationName == station))
+ .reduce((newArray, e) => newArray.concat(e), []);
+ /*Array [
+ Object {
+ "StationName": "佐古",
+ "StationNumber": "T01",
+ },
+ Object {
+ "StationName": "佐古",
+ "StationNumber": "B01",
+ },
+ ] */
+ const StationNumbers =
+ Stations &&
+ Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
+ // Array [ "T01", "B01",]
+ const lineIDs = [];
+ const EachIDs = [];
+ StationNumbers.forEach((d) => {
+ const textArray = d.split("");
+ lineIDs.push(textArray.filter((s) => "A" < s && s < "Z").join(""));
+ EachIDs.push(textArray.filter((s) => "0" <= s && s <= "9").join(""));
+ });
+ // Array [ "T", "B",]
+ // Array [ "01", "01",]
+
+ const dates = dayjs()
+ .set("hour", parseInt(time.split(":")[0]))
+ .set("minute", parseInt(time.split(":")[1]))
+ .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
+ const timeString = dates.format("HH:mm").split(":");
+
+ return (
+ openStationACFromEachTrainInfo(station)}
+ key={station}
+ >
+
+
+ {lineIDs.map((lineID, index) => (
+
+
+
+ {lineIDs[index]}
+ {"\n"}
+ {EachIDs[index]}
+
+
+
+ ))}
+
+
+ {station}
+
+ {points && points.findIndex((d) => d == index) >= 0 ? (
+ 🚊
+ ) : null}
+ {!isNaN(currentTrainData?.delay) && currentTrainData?.delay != 0 && (
+
+ {time}
+
+ )}
+
+ {timeString[0]}:{timeString[1]}
+
+
+ {se?.replace("発", "出発").replace("着", "到着")}
+
+
+
+
+ );
+};
diff --git a/components/ActionSheetComponents/EachTrainInfo/StateBox.js b/components/ActionSheetComponents/EachTrainInfo/StateBox.js
new file mode 100644
index 0000000..933b930
--- /dev/null
+++ b/components/ActionSheetComponents/EachTrainInfo/StateBox.js
@@ -0,0 +1,32 @@
+import React from "react";
+import { View, Text } from "react-native";
+
+export const StateBox = ({ text, title, style }) => (
+
+ {title}
+
+
+ {text?.match("~") ? (
+ <>
+ {text.split("~")[0]}
+ ~
+ {text.split("~")[1]}
+ >
+ ) : (
+ {text}
+ )}
+
+
+);
+const boxStyle = {
+ flex: 1,
+ backgroundColor: "white",
+ borderRadius: 10,
+ padding: 10,
+ margin: 10,
+};
+const boxTextStyle = {
+ fontSize: 25,
+ color: "#0099CC",
+ textAlign: "right",
+};
diff --git a/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js
new file mode 100644
index 0000000..a98ca15
--- /dev/null
+++ b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js
@@ -0,0 +1,74 @@
+import React from "react";
+import { View, Text, TouchableOpacity } from "react-native";
+import { StateBox } from "./StateBox";
+import {
+ heightPercentageToDP,
+ widthPercentageToDP,
+} from "react-native-responsive-screen";
+
+export const TrainDataView = ({
+ currentTrainData,
+ currentPosition,
+ nearTrainIDList,
+ openTrainInfo,
+}) => {
+ return (
+
+
+
+
+
+
+ {
+ if (nearTrainIDList.length == 0) return;
+ openTrainInfo(nearTrainIDList[0]);
+ }}
+ >
+ {nearTrainIDList.length == 0 ? (
+
+ ) : (
+
+ )}
+
+
+
+ );
+};