From b6e24e08cb286396e43d6fe7170d8281a899ba01 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 19 Mar 2024 09:38:20 +0000 Subject: [PATCH] =?UTF-8?q?Top=E3=81=AE=E3=83=AB=E3=83=BC=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=B3=E3=82=B0=E9=96=A2=E4=BF=82=E3=82=92=E6=9C=80?= =?UTF-8?q?=E9=81=A9=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apps.js | 8 +++-- Top.js | 61 ++++++++++---------------------------- components/FavoriteList.js | 7 +++-- components/news.js | 7 ++--- components/trainMenu.js | 11 ++++--- 5 files changed, 33 insertions(+), 61 deletions(-) diff --git a/Apps.js b/Apps.js index 40720ea..fe2ddcf 100644 --- a/Apps.js +++ b/Apps.js @@ -23,14 +23,16 @@ import { useDeviceOrientationChange } from "./stateBox/useDeviceOrientationChang import { SheetManager } from "react-native-actions-sheet"; import TrainMenu from "./components/trainMenu"; import { EachTrainInfoCore } from "./components/ActionSheetComponents/EachTrainInfoCore"; + +import { useNavigation } from "@react-navigation/native"; /* import StatusbarDetect from './StatusbarDetect'; var Status = StatusbarDetect(); */ -export default function Apps({ navigation, webview, stationData }) { - const { currentTrain } = useCurrentTrain(); +export default function Apps({ stationData }) { + const { webview, currentTrain } = useCurrentTrain(); const { height, width } = useWindowDimensions(); - const { navigate } = navigation; + const { navigate } = useNavigation(); var urlcache = ""; const { favoriteStation } = useFavoriteStation(); const { isLandscape, setIsLandscape } = useDeviceOrientationChange(); diff --git a/Top.js b/Top.js index 1d36df5..9f9486f 100644 --- a/Top.js +++ b/Top.js @@ -10,14 +10,9 @@ import HowTo from "./howto"; import News from "./components/news.js"; import TrainMenu from "./components/trainMenu.js"; import FavoriteList from "./components/FavoriteList.js"; -import { useFavoriteStation } from "./stateBox/useFavoriteStation"; import { optionData } from "./lib/stackOption.js"; -import { useCurrentTrain } from "./stateBox/useCurrentTrain.js"; const Stack = createStackNavigator(); export const Top = ({ navigation }) => { - const { favoriteStation, setFavoriteStation } = useFavoriteStation(); - const { webview, getCurrentTrain } = useCurrentTrain(); - //地図用 const [mapsStationData, setMapsStationData] = useState(undefined); @@ -42,16 +37,8 @@ export const Top = ({ navigation }) => { gestureEnabled: true, headerTransparent: true, }} - > - {(props) => ( - - )} - + children={() => } + /> { gestureEnabled: true, ...TransitionPresets.SlideFromRightIOS, }} - > - {(props) => } - + component={TrainBase} + /> + + + + - {(props) => } - - - {(props) => } - - - {(props) => ( - - )} - + name="trainMenu" + options={optionData} + children={() => } + /> + - {(props) => ( - - )} - + children={() => } + /> ); }; diff --git a/components/FavoriteList.js b/components/FavoriteList.js index 4888e48..b61ff3d 100644 --- a/components/FavoriteList.js +++ b/components/FavoriteList.js @@ -3,9 +3,12 @@ import { View, Text, TouchableOpacity, ScrollView } from "react-native"; import { ListItem } from "native-base"; import Icon from "react-native-vector-icons/Entypo"; import { useFavoriteStation } from "../stateBox/useFavoriteStation"; -export default function FavoriteList({ navigation, webview, stationData }) { - const { navigate } = navigation; +import { useCurrentTrain } from "../stateBox/useCurrentTrain"; +import { useNavigation } from "@react-navigation/native"; +export default function FavoriteList({ stationData }) { const { favoriteStation } = useFavoriteStation(); + const { webview } = useCurrentTrain(); + const { navigate } = useNavigation(); return ( diff --git a/components/news.js b/components/news.js index 0b95e3b..f0ac12c 100644 --- a/components/news.js +++ b/components/news.js @@ -4,11 +4,10 @@ import { WebView } from "react-native-webview"; import StatusbarDetect from "../StatusbarDetect"; import { AS } from "../storageControl"; import { news } from "../config/newsUpdate"; +import { useNavigation } from "@react-navigation/native"; var Status = StatusbarDetect(); -export default function News(props) { - const { - navigation: { navigate }, - } = props; +export default function News() { + const { navigate } = useNavigation(); return (