小整理

This commit is contained in:
harukin-expo-dev-env 2024-08-19 12:39:55 +00:00
parent ea6cc8c55a
commit e977bb29f3

View File

@ -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" }}>
運行情報 &gt;{" "}
</Text>
) : (
<></>
<Text style={{ ...descriptionStyle, color: "green" }}> &gt; </Text>
)}
<Text
style={{
fontSize: parseInt("16%"),
color: "green",
fontWeight: "bold",
}}
style={{ ...descriptionStyle, color: "green" }}
numberOfLines={numberOfLines}
>
&gt; {info}
{info}
</Text>
</View>
</TouchableOpacity>