レイアウト変更

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
style={{
flex: 3,
flexDirection: "column",
alignContent: "center",
alignSelf: "center",
alignItems: "center",
height: "100%",
backgroundColor: "white",
}}
>
<View <View
style={{ style={{
paddingHorizontal: 5,
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} />
style={{ <Text
flexDirection: "column", style={{
alignItems: "center", fontSize: 20,
borderColor: lineColor, textAlignVertical: "center",
backgroundColor: "white", margin: 0,
borderWidth: 1, padding: 0,
borderRadius: 30, flex:1
width: 25, }}
height: 25, >
}} {station[0]?.Station_JP}
> </Text>
<Text style={{ fontSize: 10, margin: 0, padding: 0 }}> <View
{s.StationNumber?.slice(0, 1)} style={{
</Text> backgroundColor: "white",
<Text style={{ fontSize: 10, margin: 0, padding: 0 }}> width: 10,
{s.StationNumber?.slice(1)} borderLeftColor: lineColor,
</Text> borderBottomColor: "white",
</View> borderBottomWidth: 24,
); borderLeftWidth: 10,
})} borderRightWidth: 0,
borderTopWidth: 0,
height: "100%",
}}
/>
</View> </View>
<View <View
style={{ style={{
backgroundColor: lineColor, height: "100%",
backgroundColor: "white",
flex: 1,
}} }}
> >
<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> <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>