各種調整
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
View,
|
||||
Image,
|
||||
LayoutAnimation,
|
||||
ScrollView,
|
||||
} from "react-native";
|
||||
import { getTrainType } from "@/lib/getTrainType";
|
||||
import { trainPosition } from "@/lib/trainPositionTextArray";
|
||||
@@ -216,8 +217,13 @@ export const FixedTrain: FC<props> = ({
|
||||
type: customData.type,
|
||||
whiteMode: true,
|
||||
});
|
||||
const trainNameText = `${customData.trainName}${
|
||||
customData.trainNumDistance !== null
|
||||
? ` ${parseInt(customData.TrainNumber) - customData.trainNumDistance}号`
|
||||
: ""
|
||||
}`;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: displaySize === 50 ? "row" : "column",
|
||||
@@ -226,10 +232,6 @@ export const FixedTrain: FC<props> = ({
|
||||
borderBottomWidth: 2,
|
||||
position: "relative",
|
||||
}}
|
||||
activeOpacity={1}
|
||||
onPress={() => {
|
||||
//setFixedPosition({ type: null, value: null });
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
@@ -255,8 +257,8 @@ export const FixedTrain: FC<props> = ({
|
||||
>
|
||||
<Image
|
||||
source={{ uri: customData.img }}
|
||||
width={displaySize === 50 ? 14 : 22}
|
||||
height={displaySize === 50 ? 17 : 25}
|
||||
width={displaySize === 50 ? 14 : 23}
|
||||
height={displaySize === 50 ? 17 : 26}
|
||||
style={{ margin: 5 }}
|
||||
/>
|
||||
<View
|
||||
@@ -264,6 +266,8 @@ export const FixedTrain: FC<props> = ({
|
||||
flexDirection: displaySize === 50 ? "row" : "column",
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
maxWidth: displaySize === 50 ? 100 : 60,
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
@@ -286,13 +290,13 @@ export const FixedTrain: FC<props> = ({
|
||||
{customData.trainName && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: customData?.trainName?.length > 6 ? 9 : 14,
|
||||
fontSize: trainNameText.length > 6 ? 8 : 14,
|
||||
color: "white",
|
||||
maxWidth: displaySize === 50 ? 65 : 200,
|
||||
maxWidth: displaySize === 50 ? 60 : 200,
|
||||
textAlignVertical: "center",
|
||||
}}
|
||||
>
|
||||
{customData.trainName}
|
||||
{trainNameText}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
@@ -332,12 +336,12 @@ export const FixedTrain: FC<props> = ({
|
||||
>
|
||||
<StationNumberMaker
|
||||
currentStation={station}
|
||||
singleSize={20}
|
||||
singleSize={18}
|
||||
useEach={true}
|
||||
/>
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 12,
|
||||
fontSize: customData?.ToData?.length > 4 ? 9 : 12,
|
||||
color: "white",
|
||||
fontWeight: "bold",
|
||||
textAlignVertical: "center",
|
||||
@@ -536,7 +540,7 @@ export const FixedTrain: FC<props> = ({
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -603,7 +607,11 @@ const CurrentPositionBox = ({
|
||||
></View>
|
||||
</View>
|
||||
)}
|
||||
<View style={{ flex: 1, flexDirection: "row", overflow: "hidden" }}>
|
||||
<ScrollView
|
||||
style={{ flex: 1, flexDirection: "row" }}
|
||||
horizontal
|
||||
overScrollMode="always"
|
||||
>
|
||||
{trainDataWithThrough.length > 0 &&
|
||||
trainDataWithThrough.map((d, index, array) => {
|
||||
if (!d) return null;
|
||||
@@ -612,10 +620,16 @@ const CurrentPositionBox = ({
|
||||
let distanceMinute = 0;
|
||||
if (time != "") {
|
||||
const now = dayjs();
|
||||
const hour = parseInt(time.split(":")[0]);
|
||||
const distanceTime = now
|
||||
.hour(time.split(":")[0])
|
||||
.hour(hour < 4 ? hour + 24 : hour)
|
||||
.minute(time.split(":")[1]);
|
||||
distanceMinute = distanceTime.diff(now, "minute") + delayTime;
|
||||
if (now.hour() < 4) {
|
||||
if (hour < 4) {
|
||||
distanceMinute = distanceMinute - 1440;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (
|
||||
<>
|
||||
@@ -654,7 +668,7 @@ const CurrentPositionBox = ({
|
||||
(time != "" && (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: isSmall ? 8 : 14,
|
||||
fontSize: isSmall ? 8 : 12,
|
||||
color: "black",
|
||||
backgroundColor: "white",
|
||||
fontWeight: "bold",
|
||||
@@ -666,8 +680,14 @@ const CurrentPositionBox = ({
|
||||
<Text
|
||||
style={{
|
||||
fontSize: isSmall ? 8 : 14,
|
||||
color: se.includes("通") ? "#020202ff" : "white",
|
||||
color: se.includes("通")
|
||||
? "#020202ff"
|
||||
: index == 1 && secondText == ""
|
||||
? "#ffe852ff"
|
||||
: "white",
|
||||
marginTop: isSmall ? 0 : 3,
|
||||
height: isSmall ? "auto" : 17,
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
{se.includes("通")
|
||||
@@ -702,7 +722,7 @@ const CurrentPositionBox = ({
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user