getTrainTypeの仕様変更に追従
This commit is contained in:
@@ -2,7 +2,7 @@ import lineColorList from "@/assets/originData/lineColorList";
|
||||
import { customTrainDataDetector } from "@/components/custom-train-data";
|
||||
import { StationNumberMaker } from "@/components/駅名表/StationNumberMaker";
|
||||
import { checkDuplicateTrainData } from "@/lib/checkDuplicateTrainData";
|
||||
import { typeID } from "@/lib/getStringConfig";
|
||||
import { CustomTrainData, trainTypeID } from "@/lib/CommonTypes";
|
||||
import { getTrainDelayStatus } from "@/lib/getTrainDelayStatus";
|
||||
import { getTrainType } from "@/lib/getTrainType";
|
||||
import { objectIsEmpty } from "@/lib/objectIsEmpty";
|
||||
@@ -182,8 +182,9 @@ export const FixedStation = ({ stationID }) => {
|
||||
if (!currentTrain) return () => {};
|
||||
const data = trainTimeAndNumber
|
||||
.filter((d) => currentTrain.map((m) => m.num).includes(d.train)) //現在の列車に絞る[ToDo]
|
||||
.filter(timeFiltering).filter(d=>!d.isThrough)
|
||||
.filter((d) => d.lastStation != station[0].Station_JP) //最終列車表示設定
|
||||
.filter(timeFiltering)
|
||||
.filter((d) => !d.isThrough)
|
||||
.filter((d) => d.lastStation != station[0].Station_JP); //最終列車表示設定
|
||||
setSelectedTrain(data);
|
||||
}, [trainTimeAndNumber, currentTrain /*finalSwitch*/]);
|
||||
|
||||
@@ -226,7 +227,7 @@ export const FixedStation = ({ stationID }) => {
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
flex: 1,
|
||||
color:"white"
|
||||
color: "white",
|
||||
}}
|
||||
>
|
||||
{station[0]?.Station_JP}
|
||||
@@ -313,7 +314,7 @@ const FixedStationBoxEachTrain = ({ d, station }) => {
|
||||
else if (currentTrainData[0].Type.includes("rapid:")) {
|
||||
const typeText = currentTrainData[0].Type.split(":");
|
||||
const returnData = {
|
||||
type: "Rapid",
|
||||
type: "Rapid" as trainTypeID,
|
||||
trainName: typeText[1].replace("\r", ""),
|
||||
trainIcon: null,
|
||||
trainNumDistance: null,
|
||||
@@ -326,25 +327,20 @@ const FixedStationBoxEachTrain = ({ d, station }) => {
|
||||
return customTrainData;
|
||||
}
|
||||
};
|
||||
const [train, setTrain] = useState<{
|
||||
ToData: string;
|
||||
TrainNumber: string;
|
||||
id: string;
|
||||
img: string;
|
||||
isWanman: boolean;
|
||||
trainName: string;
|
||||
trainNumDistance: number;
|
||||
type: typeID;
|
||||
viaData: string;
|
||||
info?: string;
|
||||
uwasa?: string;
|
||||
}>(getTrainDataFromCurrentTrain(d.train));
|
||||
const [train, setTrain] = useState<CustomTrainData>(getTrainDataFromCurrentTrain(d.train));
|
||||
useEffect(() => {
|
||||
setTrain(getTrainDataFromCurrentTrain(d.train));
|
||||
}, [currentTrain, d.train]);
|
||||
const { name, color } = getTrainType(train.type, true);
|
||||
const { name, color } = getTrainType({ type: train.type, whiteMode: true });
|
||||
return (
|
||||
<View style={{ backgroundColor: "white", flexDirection: "row",height:"33%",overflow:"visible" }}>
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: "white",
|
||||
flexDirection: "row",
|
||||
height: "33%",
|
||||
overflow: "visible",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 14, flex: 3 }}>{d.time}</Text>
|
||||
<Text style={{ fontSize: 14, flex: 4, color }}>{name}</Text>
|
||||
<Text style={{ fontSize: 14, flex: 4 }}>{d.lastStation}行</Text>
|
||||
|
Reference in New Issue
Block a user