SpecialTrainInfoを分岐
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { Text, TouchableOpacity } from "react-native";
|
||||
import React, { useState } from "react";
|
||||
export const ShowSpecialTrain = ({
|
||||
isTrainDataNothing,
|
||||
setTrainData,
|
||||
trainList,
|
||||
trueTrainID,
|
||||
}) => {
|
||||
const replaceSpecialTrainDetail = (trainNum) => {
|
||||
let TD = trainList[trainNum];
|
||||
if (!TD) return;
|
||||
setTrainData(TD.split("#").filter((d) => d != ""));
|
||||
};
|
||||
return (
|
||||
<>
|
||||
{isTrainDataNothing && trueTrainID && (
|
||||
<TouchableOpacity
|
||||
onPress={() => replaceSpecialTrainDetail(trueTrainID)}
|
||||
style={{
|
||||
padding: 10,
|
||||
flexDirection: "row",
|
||||
borderColor: "blue",
|
||||
borderWidth: 1,
|
||||
margin: 10,
|
||||
borderRadius: 5,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 18, fontWeight: "bold", color: "black" }}>
|
||||
本来の列車情報を表示
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user