現在地の走行方向の帳尻合わせとLEDの現在地表記、運行情報のテキストの消滅処理等
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
StyleSheet,
|
||||
useWindowDimensions,
|
||||
BackHandler,
|
||||
Linking,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
@@ -25,7 +26,7 @@ import { DynamicHeaderScrollView } from "../DynamicHeaderScrollView";
|
||||
import { LongHeader } from "./EachTrainInfo/LongHeader";
|
||||
import { ShortHeader } from "./EachTrainInfo/ShortHeader";
|
||||
import { ScrollStickyContent } from "./EachTrainInfo/ScrollStickyContent";
|
||||
import { getStationData } from "../../lib/eachTrainInfoCoreLib/getStationData";
|
||||
import { getStationID } from "../../lib/eachTrainInfoCoreLib/getStationData";
|
||||
import { findReversalPoints } from "../../lib/eachTrainInfoCoreLib/findReversalPoints";
|
||||
import { migrateTrainName } from "../../lib/eachTrainInfoCoreLib/migrateTrainName";
|
||||
import { getType } from "../../lib/eachTrainInfoCoreLib/getType";
|
||||
@@ -193,12 +194,20 @@ export const EachTrainInfoCore = ({
|
||||
const pos = currentTrainData?.Pos.replace("(下り)", "")
|
||||
.replace("(上り)", "")
|
||||
.split("~");
|
||||
setCurrentPosition([
|
||||
getStationData(pos[0], stationList),
|
||||
getStationData(pos[1], stationList),
|
||||
]);
|
||||
const direction = parseInt(currentTrainData?.Direction) || 0;
|
||||
if (direction == 0) {
|
||||
setCurrentPosition([
|
||||
getStationID(pos[1], stationList),
|
||||
getStationID(pos[0], stationList),
|
||||
]);
|
||||
} else {
|
||||
setCurrentPosition([
|
||||
getStationID(pos[0], stationList),
|
||||
getStationID(pos[1], stationList),
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
setCurrentPosition([getStationData(currentTrainData?.Pos, stationList)]);
|
||||
setCurrentPosition([getStationID(currentTrainData?.Pos, stationList)]);
|
||||
}
|
||||
}, [currentTrainData]);
|
||||
|
||||
@@ -239,6 +248,7 @@ export const EachTrainInfoCore = ({
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const headerItem = {
|
||||
currentTrainData,
|
||||
currentPosition,
|
||||
@@ -350,6 +360,26 @@ export const EachTrainInfoCore = ({
|
||||
trainList={trainList}
|
||||
trueTrainID={trueTrainID}
|
||||
/>
|
||||
{!trainData.length && (
|
||||
<TouchableOpacity
|
||||
onPress={() =>
|
||||
Linking.openURL(`https://twitter.com/search?q=${data.trainNum}`)
|
||||
}
|
||||
style={{
|
||||
padding: 10,
|
||||
flexDirection: "row",
|
||||
borderColor: "blue",
|
||||
borderWidth: 1,
|
||||
margin: 10,
|
||||
borderRadius: 5,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}>
|
||||
Twitterで検索
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{trainData.map((i, index) =>
|
||||
i.split(",")[1] == "提" ? (
|
||||
<DataFromButton i={i} />
|
||||
|
Reference in New Issue
Block a user