細かいレイアウト調整
This commit is contained in:
parent
d1be37e3be
commit
e29b4f5da3
@ -19,7 +19,7 @@ type Props = {
|
||||
};
|
||||
|
||||
const textConfig: TextStyle = {
|
||||
fontSize: 20,
|
||||
fontSize: 18,
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
};
|
||||
@ -34,7 +34,7 @@ export const HeaderText: FC<Props> = ({
|
||||
navigate,
|
||||
from,
|
||||
}) => {
|
||||
const trainName = useMemo(() => {
|
||||
const [typeName, trainName] = useMemo(() => {
|
||||
if (!data.limited) return "";
|
||||
const limitedArray = data.limited.split(":");
|
||||
const type = getType(limitedArray[0]);
|
||||
@ -42,24 +42,27 @@ export const HeaderText: FC<Props> = ({
|
||||
switch (true) {
|
||||
case !!limitedArray[1]:
|
||||
// 特急の場合は、列車名を取得
|
||||
return type + migrateTrainName(limitedArray[1]);
|
||||
return [type, migrateTrainName(limitedArray[1])];
|
||||
case trainData.length == 0:
|
||||
// 特急以外の場合は、列車番号を取得
|
||||
return type;
|
||||
return [type, ""];
|
||||
default:
|
||||
// 行先がある場合は、行先を取得
|
||||
return (
|
||||
type +
|
||||
return [
|
||||
type,
|
||||
migrateTrainName(
|
||||
trainData[trainData.length - 1].split(",")[0] + "行き"
|
||||
)
|
||||
);
|
||||
),
|
||||
];
|
||||
}
|
||||
}, [data.limited, trainData]);
|
||||
return (
|
||||
<View style={{ padding: 10, flexDirection: "row", alignItems: "center" }}>
|
||||
<TrainIconStatus {...{ data, navigate, from }} />
|
||||
<Text style={textConfig}>{trainName}</Text>
|
||||
<Text style={textConfig}>
|
||||
{typeName}{" "}
|
||||
{trainName}
|
||||
</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={textConfig}>
|
||||
{showHeadStation.map((d) => `${headStation[d].id} + `)}
|
||||
|
@ -83,11 +83,15 @@ export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
||||
{move ? (
|
||||
<Image
|
||||
source={{ uri: trainIcon }}
|
||||
style={{ height: 30, width: 25, margin: 5 }}
|
||||
style={{ height: 34, width: 30, marginRight: 5 }}
|
||||
resizeMethod="scale"
|
||||
/>
|
||||
) : (
|
||||
<Ionicons {...anpanmanStatus} size={30} style={{ margin: 5 }} />
|
||||
<Ionicons
|
||||
{...anpanmanStatus}
|
||||
size={30}
|
||||
style={{ marginRight: 5 }}
|
||||
/>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
@ -256,6 +256,7 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
||||
trainIcon: `https://n8n.haruk.in/webhook/dosan-anpanman-pictures.png?trainNum=${TrainNumber}&day=${dayjs().format(
|
||||
"yyyy-MM-DD"
|
||||
)}`,
|
||||
infoUrl: "https://www.jr-eki.com/aptrain/naani/dosan/train.html",
|
||||
trainNumDistance: 30,
|
||||
info: "アンパンマン列車で運転",
|
||||
};
|
||||
@ -510,7 +511,7 @@ export const customTrainDataDetector = (TrainNumber: string) => {
|
||||
type: "LTDEXP",
|
||||
trainName: "宇和海",
|
||||
trainIcon: "https://storage.haruk.in/s2002a.png",
|
||||
infoUrl: "http://jr-shikoku.co.jp/01_trainbus/vehicle-info/uwakai.html",
|
||||
infoUrl: "https://www.jr-eki.com/aptrain/naani/yosan/train.html",
|
||||
trainNumDistance: 1050,
|
||||
info: "アンパン列車で運転",
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user