差分調整
This commit is contained in:
parent
a3e8acdf20
commit
1fbbc37557
@ -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 (
|
||||
<ActionSheet
|
||||
@ -17,7 +16,7 @@ export const EachTrainInfo = (props) => {
|
||||
|
||||
//useBottomSafeAreaPadding={Platform.OS == "android"}
|
||||
>
|
||||
<EachTrainInfoCore {...{ actionSheetRef, ...props.payload }} />
|
||||
<EachTrainInfoCore {...{ actionSheetRef, ...payload }} />
|
||||
</ActionSheet>
|
||||
);
|
||||
};
|
||||
|
@ -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(() => {
|
||||
|
@ -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 (
|
||||
<ActionSheet
|
||||
|
@ -233,8 +233,6 @@ export default function LED_vision(props) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const EachData = (props) => {
|
||||
const {
|
||||
d,
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user