微調整

This commit is contained in:
harukin-expo-dev-env 2025-04-13 15:48:25 +00:00
parent ac06ca6c75
commit 6d51db98fa

View File

@ -1,10 +1,11 @@
import React from "react"; import React from "react";
import { Text, View } from "react-native"; import { Text, View } from "react-native";
import { widthPercentageToDP as wp } from "react-native-responsive-screen"; import { useWindowDimensions } from "react-native";
import lineColorList from "../../assets/originData/lineColorList"; import lineColorList from "../../assets/originData/lineColorList";
export const StationNumberMaker = (props) => { export const StationNumberMaker = (props) => {
const { currentStation, isMatsuyama } = props; const { currentStation, isMatsuyama } = props;
const { width } = useWindowDimensions();
const getTop = (array: number[], index: number) => { const getTop = (array: number[], index: number) => {
if (array.length == 1) return 20; if (array.length == 1) return 20;
else if (index == 0) return 5; else if (index == 0) return 5;
@ -24,8 +25,8 @@ export const StationNumberMaker = (props) => {
alignItems: "center", alignItems: "center",
top: `${getTop(array, index)}%`, top: `${getTop(array, index)}%`,
right: "10%", right: "10%",
width: wp("10%"), width: (width / 100 * 10),
height: wp("10%"), height: (width / 100 * 10),
borderColor: lineColorList[lineID], borderColor: lineColorList[lineID],
backgroundColor: "white", backgroundColor: "white",
borderWidth: parseInt("3%"), borderWidth: parseInt("3%"),