diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx index 33d1101..82c0ee3 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx @@ -11,6 +11,7 @@ type seTypes = | "発" | "着" | "休編" + | "通休編" | string; type currentTrainDataType = { @@ -45,6 +46,7 @@ export const EachStopList: FC = ({ if (!showThrew) { if (se == "通過") return null; if (se == "通編") return null; + if (se == "通休編") return null; } const Stations = stationList .map((a) => a.filter((d) => d.StationName == station)) @@ -77,6 +79,7 @@ export const EachStopList: FC = ({ case "頃編": return ["頃", "community"]; case "休編": + case "通休編": return ["運休", "community"]; default: return [se, "normal"]; @@ -87,7 +90,7 @@ export const EachStopList: FC = ({ // Array [ "01", "01",] const textColor = `#${seType == "community" ? "44f" : "000"}${ - se == "通過" || se == "通編" ? "5" : "" + se == "通過" || se == "通編" || se == "通休編" ? "5" : "" }`; return ( = ({ = ({ const StationNumbersBox: FC<{ stn: string; se: seTypes }> = (props) => { const { stn, se } = props; const lineColor = lineColorList[stn.charAt(0)]; - const hasThrew = se == "通過" || se == "通編" ? "80" : ""; + const hasThrew = (se == "通過" || se == "通編" || se == "通休編") ? "80" : ""; const backgroundColor = `${lineColor}${hasThrew}`; return ( @@ -216,7 +219,6 @@ const StationTimeBox: FC = (props) => { .set("hour", parseInt(time.split(":")[0])) .set("minute", parseInt(time.split(":")[1])) .add(delay == "入線" || delay == undefined ? 0 : delay, "minute"); - const timeString = se == "通過" ? "" : dates.format("HH:mm"); return ( = (props) => { fontStyle: seType == "community" ? "italic" : "normal", }} > - {se == "通過" ? "レ" : timeString} + {se.includes("通") && time == "" ? "レ" : dates.format("HH:mm")} ); }; diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index c3bfe7e..b791f49 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -96,15 +96,17 @@ export const EachTrainInfoCore = ({ return StationNumbers; }); useEffect(() => { - const stopStationList = trainData.map((i) => { + const isCancel = []; + const stopStationList = trainData.map((i,index,array) => { const [station, se, time] = i.split(","); + const [nextStation, nextSe, nextTime] = array[index+1]?.split(",") || []; + isCancel.push(se.includes("休") && nextSe.includes("休")); if (se == "通編") setHaveThrough(true); return stationList.map((a) => a.filter((d) => d.StationName == station)); }); const allThroughStationList = stopStationList.map((i, index, array) => { let allThroughStation = []; if (index == array.length - 1) return; - const firstItem = array[index]; const secondItem = array[index + 1]; let betweenStationLine = ""; @@ -129,7 +131,8 @@ export const EachTrainInfoCore = ({ d.StationNumber > baseStationNumberFirst && d.StationNumber < baseStationNumberSecond ) { - allThroughStation.push(`${d.Station_JP},通過,`); + + allThroughStation.push(`${d.Station_JP},${isCancel[index] ? "通休編" : "通過"},`); setHaveThrough(true); reverse = false; } else { @@ -137,7 +140,7 @@ export const EachTrainInfoCore = ({ d.StationNumber < baseStationNumberFirst && d.StationNumber > baseStationNumberSecond ) { - allThroughStation.push(`${d.Station_JP},通過,`); + allThroughStation.push(`${d.Station_JP},${isCancel[index] ? "通休編" : "通過"},`); setHaveThrough(true); reverse = true; } diff --git a/components/Apps/FixedPositionBox/FixedTrainBox.tsx b/components/Apps/FixedPositionBox/FixedTrainBox.tsx index 86b1ce3..4a2fb29 100644 --- a/components/Apps/FixedPositionBox/FixedTrainBox.tsx +++ b/components/Apps/FixedPositionBox/FixedTrainBox.tsx @@ -51,7 +51,6 @@ export const FixedTrain: FC = ({ }, [currentTrain, trainID]); useEffect(() => { const stationData = getCurrentStationData(trainID); - console.log(stationData); if (stationData) { setTrain(stationData); }