From 1fbbc3755733c4067f424ff47e690b52dcc3ee33 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Mon, 2 Sep 2024 14:54:27 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B7=AE=E5=88=86=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActionSheetComponents/EachTrainInfo.js | 7 +++---- .../ActionSheetComponents/EachTrainInfoCore.js | 8 ++++---- .../TrainMenuLineSelector.js | 18 +----------------- components/発車時刻表/LED_vidion.js | 2 -- components/駅名表/Sign.js | 2 +- 5 files changed, 9 insertions(+), 28 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo.js index 6331cca..450dff4 100644 --- a/components/ActionSheetComponents/EachTrainInfo.js +++ b/components/ActionSheetComponents/EachTrainInfo.js @@ -2,9 +2,8 @@ import React, { useRef } from "react"; import { Platform } from "react-native"; import ActionSheet from "react-native-actions-sheet"; import { EachTrainInfoCore } from "./EachTrainInfoCore"; -export const EachTrainInfo = (props) => { - if (!props.payload) return <>; - +export const EachTrainInfo = ({ payload }) => { + if (!payload) return <>; const actionSheetRef = useRef(null); return ( { //useBottomSafeAreaPadding={Platform.OS == "android"} > - + ); }; diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index d5638d3..e114bed 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -92,7 +92,7 @@ export const EachTrainInfoCore = ({ ); // 使用例 - const stopStationIDList = trainData.map((i, index) => { + const stopStationIDList = trainData.map((i) => { const [station, se, time] = i.split(","); const Stations = stationList.map((a) => a.filter((d) => d.StationName == station) @@ -133,7 +133,7 @@ export const EachTrainInfoCore = ({ } }, [data.limited, trainData]); - const { height, width } = useWindowDimensions(); + const { height } = useWindowDimensions(); const { isLandscape } = useDeviceOrientationChange(); const [trueTrainID, setTrueTrainID] = useState(); @@ -218,7 +218,7 @@ export const EachTrainInfoCore = ({ .then((d) => { if (d) setTrainPositionSwitch(d); }) - .catch((d) => AS.setItem("trainPositionSwitch", "false")); + .catch(() => AS.setItem("trainPositionSwitch", "false")); }, []); const openTrainInfo = (d) => { @@ -239,7 +239,7 @@ export const EachTrainInfoCore = ({ navigate, from: from == "LED" ? "LED2" : "NearTrainDiagramView", }; - if (setTrainInfo) { + if (isLandscape) { setTrainInfo(payload.data); } else { SheetManager.hide("EachTrainInfo").then(() => { diff --git a/components/ActionSheetComponents/TrainMenuLineSelector.js b/components/ActionSheetComponents/TrainMenuLineSelector.js index c983da4..758c4df 100644 --- a/components/ActionSheetComponents/TrainMenuLineSelector.js +++ b/components/ActionSheetComponents/TrainMenuLineSelector.js @@ -1,42 +1,26 @@ import React, { useEffect, useRef } from "react"; import { View, - LayoutAnimation, - ScrollView, - Linking, Text, TouchableOpacity, Platform, BackHandler, } from "react-native"; -import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; -import ActionSheet, { - SheetManager, - useScrollHandlers, -} from "react-native-actions-sheet"; -import LottieView from "lottie-react-native"; +import ActionSheet, { SheetManager } from "react-native-actions-sheet"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import ViewShot from "react-native-view-shot"; -import * as Sharing from "expo-sharing"; -import { useTrainDelayData } from "../../stateBox/useTrainDelayData"; import { useTrainMenu } from "../../stateBox/useTrainMenu"; import lineColorList from "../../assets/originData/lineColorList"; import { stationIDPair } from "../../lib/getStationList2"; import { lineListPair } from "../../lib/getStationList"; export const TrainMenuLineSelector = () => { - const { getTime, delayData, loadingDelayData, setLoadingDelayData } = - useTrainDelayData(); const { selectedLine, setSelectedLine, mapsStationData: stationData, - setMapsStationData, } = useTrainMenu(); const actionSheetRef = useRef(null); - const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef); const insets = useSafeAreaInsets(); - const viewShot = useRef(null); const platformIs = Platform.OS == "android"; return ( { const { d, diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index abaa512..e8d9ada 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -16,9 +16,9 @@ import { useStationList } from "../../stateBox/useStationList"; export default function Sign(props) { const { currentStation, oP, oLP, isCurrentStation = false } = props; - const { originalStationList } = useStationList(); const { favoriteStation, setFavoriteStation } = useFavoriteStation(); const [nexPrePosition, setNexPrePosition] = useState(0); + const { originalStationList } = useStationList(); const [preStation, setPreStation] = useState(); const [nexStation, setNexStation] = useState();