列車運行情報のstateを最高位に移動
This commit is contained in:
@@ -38,6 +38,7 @@ export const EachTrainInfo = ({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(data);
|
||||
setIsTop(true);
|
||||
if (!data.trainNum) return;
|
||||
const TD = trainList[data.trainNum];
|
||||
@@ -129,6 +130,64 @@ export const EachTrainInfo = ({
|
||||
setIsTop(e.nativeEvent.contentOffset.y < 0);
|
||||
}}
|
||||
>
|
||||
<View style={{ flexDirection: "row" }}>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: "black",
|
||||
borderRadius: 10,
|
||||
padding: 10,
|
||||
margin: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 10, color: "white" }} t>
|
||||
現在地
|
||||
</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text
|
||||
style={{ fontSize: 30, color: "white", textAlign: "right" }}
|
||||
>
|
||||
{data.trainData?.Pos}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, flexDirection: "column" }}>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: "black",
|
||||
borderRadius: 10,
|
||||
padding: 10,
|
||||
margin: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 10, color: "white" }}>
|
||||
{isNaN(data.trainData?.delay) ? "状態" : "遅延時分"}
|
||||
</Text>
|
||||
<Text
|
||||
style={{ fontSize: 30, color: "white", textAlign: "right" }}
|
||||
>
|
||||
{data.trainData?.delay}
|
||||
{isNaN(data.trainData?.delay) ? "" : "分"}
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: "black",
|
||||
borderRadius: 10,
|
||||
padding: 10,
|
||||
margin: 10,
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 10, color: "white" }}>列番</Text>
|
||||
<Text
|
||||
style={{ fontSize: 30, color: "white", textAlign: "right" }}
|
||||
>
|
||||
{data.trainData?.num}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
padding: 10,
|
||||
@@ -138,7 +197,6 @@ export const EachTrainInfo = ({
|
||||
}}
|
||||
>
|
||||
<View style={{ alignItems: "center" }}>
|
||||
<Text>{data.delay}</Text>
|
||||
{/* <LottieView
|
||||
autoPlay
|
||||
loop
|
||||
|
Reference in New Issue
Block a user