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