下部の駅ナンバーも色が路線に応じて可変するように変更、文字を太字に変更

This commit is contained in:
harukin-expo-dev-env 2024-08-31 09:46:50 +00:00
parent 85bdb26823
commit c98f7db36d
2 changed files with 17 additions and 7 deletions

View File

@ -2,6 +2,7 @@ import React, { CSSProperties, FC } from "react";
import { widthPercentageToDP as wp } from "react-native-responsive-screen"; import { widthPercentageToDP as wp } from "react-native-responsive-screen";
import { Text, TextStyle, View, ViewStyle } from "react-native"; import { Text, TextStyle, View, ViewStyle } from "react-native";
import { StationName } from "./StationName"; import { StationName } from "./StationName";
import lineColorList from "../../assets/originData/lineColorList";
export const NextPreStationLine = ({ nexStation, preStation, isMatsuyama }) => { export const NextPreStationLine = ({ nexStation, preStation, isMatsuyama }) => {
return ( return (
<View style={}> <View style={}>
@ -52,16 +53,25 @@ const BottomSideArrow: FC<FCimport> = ({ isMatsuyama, children }) => {
}; };
const BottomStationNumberView: FC<FCimport> = ({ isMatsuyama, children }) => { const BottomStationNumberView: FC<FCimport> = ({ isMatsuyama, children }) => {
const lineID = children.slice(0, 1);
const lineName = children.slice(1);
return ( return (
<View style={isMatsuyama ? 下枠駅ナンバーB : 下枠駅ナンバー}> <View
style={{
...(isMatsuyama ? 下枠駅ナンバーB : 下枠駅ナンバー),
borderColor: lineColorList[lineID],
}}
>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
<Text <Text
style={{ style={{
fontSize: parseInt("10%"), fontSize: parseInt("10%"),
color: isMatsuyama ? "black" : "white", color: "black",
textAlign: "center",
fontWeight: "bold",
}} }}
> >
{children} {lineID + "\n" + lineName}
</Text> </Text>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
</View> </View>
@ -87,8 +97,8 @@ const 下枠駅ナンバー: ViewStyle = {
width: wp("8%"), width: wp("8%"),
height: wp("8%"), height: wp("8%"),
margin: wp("1%"), margin: wp("1%"),
borderColor: "white", backgroundColor: "white",
borderWidth: parseInt("2%"), borderWidth: parseInt("3%"),
borderRadius: parseInt("100%"), borderRadius: parseInt("100%"),
}; };
const 下枠駅ナンバーB: ViewStyle = { const 下枠駅ナンバーB: ViewStyle = {
@ -97,8 +107,7 @@ const 下枠駅ナンバーB: ViewStyle = {
width: wp("7%"), width: wp("7%"),
height: wp("7%"), height: wp("7%"),
margin: wp("2%"), margin: wp("2%"),
borderColor: "black",
backgroundColor: "white", backgroundColor: "white",
borderWidth: parseInt("2%"), borderWidth: parseInt("3%"),
borderRadius: parseInt("100%"), borderRadius: parseInt("100%"),
}; };

View File

@ -41,6 +41,7 @@ export const StationNumberMaker = (props) => {
padding: 0, padding: 0,
textAlign: "center", textAlign: "center",
color: "black", color: "black",
fontWeight: "bold",
}} }}
> >
{lineID + "\n" + lineName} {lineID + "\n" + lineName}