From f5e4947c3bad839fb6022904e77da03e03c24dca Mon Sep 17 00:00:00 2001 From: harukin-DeskMini Date: Mon, 30 Jan 2023 00:04:18 +0900 Subject: [PATCH] =?UTF-8?q?navigation=E3=81=AE=E5=88=B6=E5=BE=A1=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=A4=9A=E5=B0=91=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 112 +++++++++++++++++++++++----------------- Apps.js | 8 ++- components/trainMenu.js | 2 +- 3 files changed, 70 insertions(+), 52 deletions(-) diff --git a/App.js b/App.js index 74cbb29..73761d3 100644 --- a/App.js +++ b/App.js @@ -10,12 +10,12 @@ import { Platform, UIManager } from "react-native"; import { UpdateAsync } from "./UpdateAsync.js"; import Apps from "./Apps"; import tndView from "./ndView"; -import trainbase from "./trainbaseview"; -import howto from "./howto"; +import TrainBase from "./trainbaseview"; +import HowTo from "./howto"; import menu from "./menu"; import News from "./components/news.js"; import Setting from "./components/settings.js"; -import trainMenu from "./components/trainMenu.js"; +import TrainMenu from "./components/trainMenu.js"; import FavoriteList from "./components/FavoriteList.js"; const Stack = createStackNavigator(); const Tab = createBottomTabNavigator(); @@ -25,14 +25,14 @@ if (Platform.OS === "android") { } } export default function App() { - const navigationRef = useRef(); useEffect(() => { UpdateAsync(); }, []); + return ( - + - , }} /> - , }} /> - ); } -const top = () => ( - - - - - - - - -); +const top = ({ navigation }) => { + useEffect(() => { + const unsubscribe = navigation.addListener("tabLongPress", (e) => { + alert("longPress!"); + navigation.navigate("favoriteList", { webview, stationData }); + }); + + return unsubscribe; + }, [navigation]); + + const webview = useRef(); + return ( + + + {(props) => } + + + {(props) => } + + + {(props) => } + + + {(props) => } + + + {(props) => } + + + {(props) => } + + + ); +}; function menuPage() { return ( @@ -118,7 +138,7 @@ function menuPage() {