From c92f02fa0e35f1e2200e171fb191fb9e91346cfd Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 15 Jun 2025 05:20:11 +0000 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E6=A9=9F=E8=83=BD=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GeneralWebView.tsx | 30 +++++++++++++++++++ MenuPage.js | 2 ++ Top.js | 2 ++ .../EachTrainInfoCore/HeaderText.tsx | 13 ++++++-- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 GeneralWebView.tsx diff --git a/GeneralWebView.tsx b/GeneralWebView.tsx new file mode 100644 index 0000000..dbc47ea --- /dev/null +++ b/GeneralWebView.tsx @@ -0,0 +1,30 @@ +import React, { CSSProperties } from "react"; +import { View, ViewProps } from "react-native"; +import { WebView } from "react-native-webview"; +import { BigButton } from "./components/atom/BigButton"; +import { useNavigation } from "@react-navigation/native"; +export default ({ route }) => { + if (!route.params) { + return null; + } + const { uri, useExitButton = true } = route.params; + const { goBack } = useNavigation(); + return ( + + { + const { data } = event.nativeEvent; + const {type} = JSON.parse(data); + if (type === "windowClose") return goBack(); + }} + /> + {useExitButton && } + + ); +}; +const styles: ViewProps["style"] = { + height: "100%", + backgroundColor: "#0099CC", +}; diff --git a/MenuPage.js b/MenuPage.js index de4f199..6f00ec3 100644 --- a/MenuPage.js +++ b/MenuPage.js @@ -18,6 +18,7 @@ import AllTrainDiagramView from "./components/AllTrainDiagramView"; import { useNavigation } from "@react-navigation/native"; import { news } from "./config/newsUpdate"; import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs"; +import GeneralWebView from "./GeneralWebView"; const Stack = createStackNavigator(); export function MenuPage() { @@ -128,6 +129,7 @@ export function MenuPage() { component={AllTrainDiagramView} /> + ); } diff --git a/Top.js b/Top.js index 4e547b8..5f25b74 100644 --- a/Top.js +++ b/Top.js @@ -13,6 +13,7 @@ import { useTrainMenu } from "./stateBox/useTrainMenu"; import { AS } from "./storageControl"; import { news } from "./config/newsUpdate"; import { Linking, Platform } from "react-native"; +import GeneralWebView from "./GeneralWebView"; const Stack = createStackNavigator(); export const Top = () => { const { webview } = useCurrentTrain(); @@ -64,6 +65,7 @@ export const Top = () => { component={TrainBase} /> + = ({ return ( scrollHandlers.ref.current?.scrollTo({ y: 0, animated: true })}> - { + navigate("generalWebView", { + uri: "https://jr-shikoku-data-post-system.pages.dev?trainNum=" + trainNum, + useExitButton: false + }); + SheetManager.hide("EachTrainInfo"); + }} > = ({ {isOneMan && } {trainName} - +