ファイル移動

This commit is contained in:
harukin-expo-dev-env
2025-09-07 14:54:34 +00:00
parent 5d9a7e185f
commit 869731eedf
3 changed files with 551 additions and 538 deletions

View File

@@ -0,0 +1,98 @@
import lineColorList from "@/assets/originData/lineColorList";
import { useCurrentTrain } from "@/stateBox/useCurrentTrain";
import { useStationList, StationProps } from "@/stateBox/useStationList";
import { useEffect, useState } from "react";
import { Text, TouchableOpacity, View } from "react-native";
export const FixedStation = ({ stationID }) => {
const { fixedPosition, setFixedPosition } = useCurrentTrain();
const { getStationDataFromId } = useStationList();
const [station, setStation] = useState<StationProps[]>([]);
useEffect(() => {
const data = getStationDataFromId(stationID);
setStation(data);
}, [stationID]);
console.log(station);
const lineColor =
station.length > 0
? lineColorList[station[0]?.StationNumber.slice(0, 1)]
: "white";
return (
<TouchableOpacity
style={{ flex: 1, flexDirection: "column" }}
onPress={() => {
setFixedPosition({ type: null, value: null });
}}
>
<View style={{ flex: 1, flexDirection: "row" }}>
<View
style={{
paddingHorizontal: 5,
backgroundColor: lineColor,
flexDirection: "row",
}}
>
{station.map((s) => {
if (s.StationNumber === null) return null;
return (
<View
key={s.StationNumber}
style={{
flexDirection: "column",
alignItems: "center",
borderColor: lineColor,
backgroundColor: "white",
borderWidth: 1,
borderRadius: 30,
width: 25,
height: 25,
}}
>
<Text style={{ fontSize: 10, margin: 0, padding: 0 }}>
{s.StationNumber?.slice(0, 1)}
</Text>
<Text style={{ fontSize: 10, margin: 0, padding: 0 }}>
{s.StationNumber?.slice(1)}
</Text>
</View>
);
})}
</View>
<View
style={{
backgroundColor: lineColor,
}}
>
<Text style={{ fontSize: 20 }}>{station[0]?.Station_JP}</Text>
</View>
<View
style={{
backgroundColor: lineColor,
width: 10,
borderLeftColor: lineColor,
borderBottomColor: "white",
borderBottomWidth: 25,
borderLeftWidth: 10,
borderRightWidth: 0,
borderTopWidth: 0,
}}
></View>
<View style={{ backgroundColor: "white", flex: 1 }}>
<Text style={{ fontSize: 20 }}></Text>
</View>
</View>
<View
style={{
flex: 1,
flexDirection: "row",
backgroundColor: lineColor,
}}
>
<View style={{ backgroundColor: "white", flex: 1 }}>
<Text style={{ fontSize: 20 }}>15:00  </Text>
</View>
</View>
</TouchableOpacity>
);
};