diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js index 9f3d451..3fa4f41 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.js +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.js @@ -46,7 +46,10 @@ export const EachStopList = ({ .set("minute", parseInt(time.split(":")[1])) .add(isNaN(currentTrainData?.delay) ? 0 : currentTrainData.delay, "minute"); const timeString = se == "通過" ? "" : dates.format("HH:mm").split(":"); - + const onClickStateText = (string) => { + if (string != "通過") return; + alert("この駅は通過駅です"); + }; return ( @@ -140,6 +143,7 @@ export const EachStopList = ({ : "red", width: 60, }} + onPress={() => onClickStateText(se)} > {se == "通過" ? "レ" : `${timeString[0]}:${timeString[1]}`} diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index ef078e2..acdd83d 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -10,6 +10,7 @@ import { LayoutAnimation, } from "react-native"; import { SheetManager } from "react-native-actions-sheet"; +import { useFonts } from "expo-font"; import { AS } from "../../storageControl"; import trainList from "../../assets/originData/trainList"; import { lineListPair } from "../../lib/getStationList"; @@ -44,6 +45,10 @@ export const EachTrainInfoCore = ({ from, navigate, }) => { + const [fontLoaded, error] = useFonts({ + "JR-Nishi": require("../../assets/fonts/西日本方向幕ロゴ.otf"), + "Zou": require("../../assets/fonts/DelaGothicOne-Regular.ttf"), + }); // const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false); const { currentTrain } = useCurrentTrain(); const { originalStationList, stationList } = useStationList(); @@ -405,6 +410,7 @@ export const EachTrainInfoCore = ({ tailStation={tailStation} navigate={navigate} from={from} + fontLoaded={fontLoaded} /> ) diff --git a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx index 0dfc71c..e0e3b65 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx +++ b/components/ActionSheetComponents/EachTrainInfoCore/HeaderText.tsx @@ -6,7 +6,6 @@ import { getType } from "../../../lib/eachTrainInfoCoreLib/getType"; import { migrateTrainName } from "../../../lib/eachTrainInfoCoreLib/migrateTrainName"; import { TrainIconStatus } from "./trainIconStatus"; import { TrainViewIcon } from "./trainViewIcon"; -import { useFonts } from "expo-font"; type Props = { data: { trainNum: string; limited: string }; @@ -17,6 +16,7 @@ type Props = { tailStation: { id: string }[]; navigate: any; from: string; + fontLoaded: boolean; }; const textConfig: TextStyle = { @@ -34,11 +34,8 @@ export const HeaderText: FC = ({ tailStation, navigate, from, + fontLoaded, }) => { - const [loaded, error] = useFonts({ - "JR-Nishi": require("../../../assets/fonts/西日本方向幕ロゴ.otf"), - "Zou": require("../../../assets/fonts/DelaGothicOne-Regular.ttf"), - }); const [typeName, trainName] = useMemo(() => { if (!data.limited) return ""; const limitedArray = data.limited.split(":"); @@ -73,7 +70,7 @@ export const HeaderText: FC = ({ alignItems: "center", }} > - {loaded ? ( + {fontLoaded ? ( <>