時刻が表示できないバグを修正

This commit is contained in:
harukin-expo-dev-env
2025-08-24 03:32:41 +00:00
parent c2226eb49e
commit 8792d3a770
2 changed files with 27 additions and 22 deletions

View File

@@ -8,7 +8,7 @@ type seTypes = "発編" | "着編" | "通編" | "頃編" | "発" | "着" | strin
type currentTrainDataType = {
Index: number;
num: string;
delay: "入線" | number;
delay: "入線" | number | undefined;
Pos: string;
PosNum: number;
Direction: number;
@@ -128,22 +128,24 @@ export const EachStopList: FC<props> = ({
)}
</View>
{currentTrainData.delay != "入線" && currentTrainData?.delay != 0 && (
<Text
style={{
fontSize: 15,
color: textColor,
width: 60,
position: "absolute",
right: 120,
textAlign: "right",
textDecorationLine: "line-through",
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
{time}
</Text>
)}
{currentTrainData?.delay &&
currentTrainData?.delay != "入線" &&
currentTrainData?.delay != 0 && (
<Text
style={{
fontSize: 15,
color: textColor,
width: 60,
position: "absolute",
right: 120,
textAlign: "right",
textDecorationLine: "line-through",
fontStyle: seType == "community" ? "italic" : "normal",
}}
>
{time}
</Text>
)}
<StationTimeBox
delay={currentTrainData?.delay}
textColor={textColor}
@@ -186,7 +188,7 @@ const StationNumbersBox: FC<{ stn: string; se: seTypes }> = (props) => {
};
type StationTimeBoxType = {
delay: "入線" | number;
delay: "入線" | number | undefined;
textColor: string;
seType: seTypes;
se: string;
@@ -198,13 +200,16 @@ const StationTimeBox: FC<StationTimeBoxType> = (props) => {
const dates = dayjs()
.set("hour", parseInt(time.split(":")[0]))
.set("minute", parseInt(time.split(":")[1]))
.add(delay == "入線" ? 0 : delay, "minute");
.add(delay == "入線" || delay == undefined ? 0 : delay, "minute");
const timeString = se == "通過" ? "" : dates.format("HH:mm");
return (
<Text
style={{
fontSize: 20,
color: delay != "入線" ? delay != 0 && "red" : textColor,
color:
delay != "入線" && delay != undefined
? delay != 0 && "red"
: textColor,
width: 60,
fontStyle: seType == "community" ? "italic" : "normal",
}}

View File

@@ -471,10 +471,10 @@ export const EachTrainInfoCore = ({
borderWidth: 1,
margin: 10,
borderRadius: 5,
alignItems: "center",
alignItems: "center", backgroundColor:"#ffffffc2"
}}
>
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}>
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black",}}>
Twitterで検索
</Text>
</TouchableOpacity>