オリジナルダイヤ表示反映に対応
This commit is contained in:
@@ -12,9 +12,9 @@ export const EachStopList = ({
|
||||
openStationACFromEachTrainInfo,
|
||||
showThrew,
|
||||
}) => {
|
||||
if(!showThrew){
|
||||
if(i.split(",")[1] == "通過") return null;
|
||||
if(i.split(",")[1] == "通編") return null;
|
||||
if (!showThrew) {
|
||||
if (i.split(",")[1] == "通過") return null;
|
||||
if (i.split(",")[1] == "通編") return null;
|
||||
}
|
||||
const [station, se, time] = i.split(","); // 阿波池田,発,6:21
|
||||
const Stations = stationList
|
||||
@@ -33,6 +33,24 @@ export const EachStopList = ({
|
||||
const StationNumbers =
|
||||
Stations &&
|
||||
Stations.filter((d) => d.StationNumber).map((d) => d.StationNumber);
|
||||
const [seString, seType] = (() => {
|
||||
switch (se) {
|
||||
case "発":
|
||||
return ["出発", "normal"];
|
||||
case "着":
|
||||
return ["到着", "normal"];
|
||||
case "発編":
|
||||
return ["出発", "community"];
|
||||
case "着編":
|
||||
return ["到着", "community"];
|
||||
case "通編":
|
||||
return ["通過", "community"];
|
||||
case "頃編":
|
||||
return ["頃", "community"];
|
||||
default:
|
||||
return [se, "normal"];
|
||||
}
|
||||
})();
|
||||
// Array [ "T01", "B01",]
|
||||
const lineIDs = [];
|
||||
const EachIDs = [];
|
||||
@@ -48,7 +66,7 @@ export const EachStopList = ({
|
||||
.set("hour", parseInt(time.split(":")[0]))
|
||||
.set("minute", parseInt(time.split(":")[1]))
|
||||
.add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute");
|
||||
const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":");
|
||||
const timeString = se == "通過" ? "" : dates.format("HH:mm");
|
||||
|
||||
return (
|
||||
<TouchableWithoutFeedback
|
||||
@@ -58,7 +76,12 @@ export const EachStopList = ({
|
||||
}
|
||||
key={station}
|
||||
>
|
||||
<View style={{ flexDirection: "row", backgroundColor: "white" }}>
|
||||
<View
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
backgroundColor: seType == "community" ? "#e3ffcdff" : "white",
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
width: 35,
|
||||
@@ -72,7 +95,7 @@ export const EachStopList = ({
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: `${lineColorList[lineID]}${
|
||||
se == "通過" ? "80" : ""
|
||||
se == "通過" || se == "通編" ? "80" : ""
|
||||
}`,
|
||||
flex: 1,
|
||||
}}
|
||||
@@ -105,7 +128,11 @@ export const EachStopList = ({
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{ fontSize: 20, color: `#000${se == "通過" ? "5" : ""}` }}
|
||||
style={{
|
||||
fontSize: 20,
|
||||
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
|
||||
fontStyle: seType == "community" ? "italic" : "normal",
|
||||
}}
|
||||
>
|
||||
{station}
|
||||
</Text>
|
||||
@@ -122,12 +149,13 @@ export const EachStopList = ({
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 15,
|
||||
color: "black",
|
||||
color: `#000${se == "通過" || se == "通編" ? "5" : ""}`,
|
||||
width: 60,
|
||||
position: "absolute",
|
||||
right: 120,
|
||||
textAlign: "right",
|
||||
textDecorationLine: "line-through",
|
||||
fontStyle: seType == "community" ? "italic" : "normal",
|
||||
}}
|
||||
>
|
||||
{time}
|
||||
@@ -137,18 +165,17 @@ export const EachStopList = ({
|
||||
style={{
|
||||
fontSize: 20,
|
||||
color: isNaN(currentTrainData?.delay)
|
||||
? "black"
|
||||
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
|
||||
: currentTrainData?.delay == 0
|
||||
? "black"
|
||||
? `#000${se == "通過" || se == "通編" ? "5" : ""}`
|
||||
: "red",
|
||||
width: 60,
|
||||
fontStyle: seType == "community" ? "italic" : "normal",
|
||||
}}
|
||||
>
|
||||
{se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`}
|
||||
</Text>
|
||||
<Text style={{ fontSize: 18, width: 50 }}>
|
||||
{se?.replace("発", "出発").replace("着", "到着")}
|
||||
{se == "通過" ? "レ" : timeString}
|
||||
</Text>
|
||||
<Text style={{ fontSize: 18, width: 50,color:`#000${se == "通過" || se == "通編" ? "5" : ""}` }}>{seString}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
|
@@ -14,24 +14,29 @@ export const ShowSpecialTrain = ({
|
||||
};
|
||||
return (
|
||||
<>
|
||||
{isTrainDataNothing && trueTrainID && (
|
||||
<TouchableOpacity
|
||||
onPress={() => replaceSpecialTrainDetail(trueTrainID)}
|
||||
style={{
|
||||
padding: 10,
|
||||
flexDirection: "row",
|
||||
borderColor: "blue",
|
||||
borderWidth: 1,
|
||||
margin: 10,
|
||||
borderRadius: 5,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}>
|
||||
本来の列車情報を表示
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{isTrainDataNothing &&
|
||||
trueTrainID?.map((ids) => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => replaceSpecialTrainDetail(ids)}
|
||||
style={{
|
||||
padding: 10,
|
||||
flexDirection: "row",
|
||||
borderColor: "blue",
|
||||
borderWidth: 1,
|
||||
margin: 10,
|
||||
borderRadius: 5,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{ fontSize: 18, fontWeight: "bold", color: "black" }}
|
||||
>
|
||||
本来の列車情報候補を表示:({ids})
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user