小整理
This commit is contained in:
parent
ea6cc8c55a
commit
e977bb29f3
@ -63,26 +63,13 @@ export default function LED_vision(props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
AS.getItem("LEDSettings/trainIDSwitch").then((data) => {
|
AS.getItem("LEDSettings/trainIDSwitch").then((data) => {
|
||||||
console.log(data);
|
setTrainIDSwitch(data === "true");
|
||||||
if (data == "true") {
|
|
||||||
setTrainIDSwitch(true);
|
|
||||||
} else {
|
|
||||||
setTrainIDSwitch(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
AS.getItem("LEDSettings/trainDescriptionSwitch").then((data) => {
|
AS.getItem("LEDSettings/trainDescriptionSwitch").then((data) => {
|
||||||
if (data == "true") {
|
setTrainDescriptionSwitch(data == "true");
|
||||||
setTrainDescriptionSwitch(true);
|
|
||||||
} else {
|
|
||||||
setTrainDescriptionSwitch(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
AS.getItem("LEDSettings/finalSwitch").then((data) => {
|
AS.getItem("LEDSettings/finalSwitch").then((data) => {
|
||||||
if (data == "true") {
|
setFinalSwitch(data == "true");
|
||||||
setFinalSwitch(true);
|
|
||||||
} else {
|
|
||||||
setFinalSwitch(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -520,6 +507,10 @@ const StatusAndDelay = ({ trainDelayStatus }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const descriptionStyle = {
|
||||||
|
fontSize: parseInt("16%"),
|
||||||
|
fontWeight: "bold",
|
||||||
|
};
|
||||||
const Description = ({ info, numberOfLines = 0, onClick }) => (
|
const Description = ({ info, numberOfLines = 0, onClick }) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
@ -536,28 +527,18 @@ const Description = ({ info, numberOfLines = 0, onClick }) => (
|
|||||||
>
|
>
|
||||||
<View style={{ flex: 4, flexDirection: "row" }}>
|
<View style={{ flex: 4, flexDirection: "row" }}>
|
||||||
{numberOfLines == 1 ? (
|
{numberOfLines == 1 ? (
|
||||||
<Text
|
<Text style={{ ...descriptionStyle, color: "red" }}>
|
||||||
style={{
|
運行情報 >{" "}
|
||||||
fontSize: parseInt("16%"),
|
|
||||||
color: "red",
|
|
||||||
fontWeight: "bold",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
運行情報
|
|
||||||
</Text>
|
</Text>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<Text style={{ ...descriptionStyle, color: "green" }}> > </Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{ ...descriptionStyle, color: "green" }}
|
||||||
fontSize: parseInt("16%"),
|
|
||||||
color: "green",
|
|
||||||
fontWeight: "bold",
|
|
||||||
}}
|
|
||||||
numberOfLines={numberOfLines}
|
numberOfLines={numberOfLines}
|
||||||
>
|
>
|
||||||
> {info}
|
{info}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
Loading…
Reference in New Issue
Block a user