Merge commit '01378c2f7e3004ecd500d6611117af4d343335c2' into feature/position-tracking-system
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
type nameString =
|
||||
| "Rapid"
|
||||
| "LTDEXP"
|
||||
| "NightLTDEXP"
|
||||
| "SPCL"
|
||||
| "Normal"
|
||||
| string;
|
||||
type colorString = "aqua" | "red" | "#297bff" | "#ff7300ff" | "#00869ecc" | "#727272cc" | "white" | "pink";
|
||||
import { typeID } from "./getStringConfig";
|
||||
|
||||
export type colorString =
|
||||
| "aqua"
|
||||
| "red"
|
||||
| "#297bff"
|
||||
| "#ff7300ff"
|
||||
| "#00869ecc"
|
||||
| "#727272cc"
|
||||
| "#00b8d8cc"
|
||||
| "#e000b0ff"
|
||||
| "white"
|
||||
| "black"
|
||||
| "pink";
|
||||
type trainTypeString =
|
||||
| "快速"
|
||||
| "特急"
|
||||
@@ -21,24 +27,35 @@ type trainTypeString =
|
||||
| "単機回送"
|
||||
| "その他";
|
||||
type trainTypeDataString = "rapid" | "express" | "normal" | "notService";
|
||||
type getTrainType = (d: nameString) => {
|
||||
type getTrainType = (
|
||||
d: typeID,
|
||||
isWhiteMode?: boolean
|
||||
) => {
|
||||
color: colorString;
|
||||
name: trainTypeString;
|
||||
data: trainTypeDataString;
|
||||
};
|
||||
export const getTrainType: getTrainType = (nameString) => {
|
||||
export const getTrainType: getTrainType = (nameString, whiteMode) => {
|
||||
switch (nameString) {
|
||||
case "Normal":
|
||||
return { color: "white", name: "普通列車", data: "normal" };
|
||||
return {
|
||||
color: whiteMode ? "black" : "white",
|
||||
name: "普通列車",
|
||||
data: "normal",
|
||||
};
|
||||
case "OneMan":
|
||||
return { color: "white", name: "普通列車(ワンマン)", data: "normal" };
|
||||
return {
|
||||
color: whiteMode ? "black" : "white",
|
||||
name: "普通列車(ワンマン)",
|
||||
data: "normal",
|
||||
};
|
||||
case "Rapid":
|
||||
case "OneManRapid":
|
||||
return { color: "aqua", name: "快速", data: "rapid" };
|
||||
return { color: whiteMode ? "#00b8d8cc" : "aqua", name: "快速", data: "rapid" };
|
||||
case "LTDEXP":
|
||||
return { color: "red", name: "特急", data: "express" };
|
||||
case "NightLTDEXP":
|
||||
return { color: "pink", name: "寝台特急", data: "express" };
|
||||
return { color: whiteMode ? "#e000b0ff":"pink", name: "寝台特急", data: "express" };
|
||||
case "SPCL":
|
||||
case "SPCL_Normal":
|
||||
return { color: "#297bff", name: "臨時", data: "normal" };
|
||||
@@ -55,6 +72,10 @@ export const getTrainType: getTrainType = (nameString) => {
|
||||
case "FreightForwarding":
|
||||
return { color: "#727272cc", name: "単機回送", data: "notService" };
|
||||
default:
|
||||
return { color: "white", name: "その他", data: "normal" };
|
||||
return {
|
||||
color: whiteMode ? "black" : "white",
|
||||
name: "その他",
|
||||
data: "normal",
|
||||
};
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user