レイアウト変更

This commit is contained in:
harukin-expo-dev-env
2025-09-08 11:22:36 +00:00
parent 869731eedf
commit b76f1adec1

View File

@@ -1,4 +1,5 @@
import lineColorList from "@/assets/originData/lineColorList"; import lineColorList from "@/assets/originData/lineColorList";
import { StationNumberMaker } from "@/components/駅名表/StationNumberMaker";
import { useCurrentTrain } from "@/stateBox/useCurrentTrain"; import { useCurrentTrain } from "@/stateBox/useCurrentTrain";
import { useStationList, StationProps } from "@/stateBox/useStationList"; import { useStationList, StationProps } from "@/stateBox/useStationList";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@@ -12,83 +13,88 @@ export const FixedStation = ({ stationID }) => {
const data = getStationDataFromId(stationID); const data = getStationDataFromId(stationID);
setStation(data); setStation(data);
}, [stationID]); }, [stationID]);
console.log(station);
const lineColor = const lineColor =
station.length > 0 station.length > 0
? lineColorList[station[0]?.StationNumber.slice(0, 1)] ? lineColorList[station[0]?.StationNumber.slice(0, 1)]
: "white"; : "white";
return ( return (
<TouchableOpacity <TouchableOpacity
style={{ flex: 1, flexDirection: "column" }} style={{ flex: 1, flexDirection: "row" }}
onPress={() => { onPress={() => {
setFixedPosition({ type: null, value: null }); setFixedPosition({ type: null, value: null });
}} }}
> >
<View style={{ flex: 1, flexDirection: "row" }}>
<View <View
style={{ style={{
paddingHorizontal: 5, flex: 3,
flexDirection: "column",
alignContent: "center",
alignSelf: "center",
alignItems: "center",
height: "100%",
backgroundColor: "white",
}}
>
<View
style={{
backgroundColor: lineColor, backgroundColor: lineColor,
flexDirection: "row", flexDirection: "row",
width: "100%",
}} }}
> >
{station.map((s) => { <StationNumberMaker
if (s.StationNumber === null) return null; currentStation={station}
return ( singleSize={20}
<View useEach={true}
key={s.StationNumber} />
<Text
style={{
fontSize: 20,
textAlignVertical: "center",
margin: 0,
padding: 0,
flex:1
}}
>
{station[0]?.Station_JP}
</Text>
<View
style={{ style={{
flexDirection: "column",
alignItems: "center",
borderColor: lineColor,
backgroundColor: "white", 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, width: 10,
borderLeftColor: lineColor, borderLeftColor: lineColor,
borderBottomColor: "white", borderBottomColor: "white",
borderBottomWidth: 25, borderBottomWidth: 24,
borderLeftWidth: 10, borderLeftWidth: 10,
borderRightWidth: 0, borderRightWidth: 0,
borderTopWidth: 0, borderTopWidth: 0,
height: "100%",
}} }}
></View> />
<View style={{ backgroundColor: "white", flex: 1 }}> </View>
<View
style={{
height: "100%",
backgroundColor: "white",
flex: 1,
}}
>
<Text style={{ fontSize: 20 }}></Text> <Text style={{ fontSize: 20 }}></Text>
</View> </View>
</View> </View>
<View <View
style={{ style={{
flex: 1, flex: 5,
flexDirection: "row", flexDirection: "column",
backgroundColor: lineColor, backgroundColor: lineColor,
}} }}
> >
<View style={{ backgroundColor: "white", flex: 1 }}>
<Text style={{ fontSize: 20 }}>15:00  </Text>
</View>
<View style={{ backgroundColor: "white", flex: 1 }}> <View style={{ backgroundColor: "white", flex: 1 }}>
<Text style={{ fontSize: 20 }}>15:00  </Text> <Text style={{ fontSize: 20 }}>15:00  </Text>
</View> </View>