52 lines
1.9 KiB
JavaScript
52 lines
1.9 KiB
JavaScript
import React, { useEffect, useState, useRef } from "react";
|
|
import {
|
|
View,
|
|
LayoutAnimation,
|
|
Text,
|
|
TouchableOpacity,
|
|
Platform,
|
|
StyleSheet,
|
|
useWindowDimensions,
|
|
} from "react-native";
|
|
import { Ionicons } from "@expo/vector-icons";
|
|
import ActionSheet, {
|
|
SheetManager,
|
|
useScrollHandlers,
|
|
} from "react-native-actions-sheet";
|
|
import { AS } from "../../storageControl";
|
|
import trainList from "../../assets/originData/trainList";
|
|
import { lineList } from "../../lib/getStationList";
|
|
import { heightPercentageToDP } from "react-native-responsive-screen";
|
|
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
|
|
import { checkDuplicateTrainData } from "../../lib/checkDuplicateTrainData";
|
|
import { getTrainType } from "../../lib/getTrainType";
|
|
import { customTrainDataDetector } from "../custom-train-data";
|
|
import { useBusAndTrainData } from "../../stateBox/useBusAndTrainData";
|
|
import { EachStopList } from "./EachTrainInfo/EachStopList";
|
|
import { DataFromButton } from "./EachTrainInfo/DataFromButton";
|
|
import { DynamicHeaderScrollView } from "../DynamicHeaderScrollView";
|
|
import { LongHeader } from "./EachTrainInfo/LongHeader";
|
|
import { ShortHeader } from "./EachTrainInfo/ShortHeader";
|
|
import { ScrollStickyContent } from "./EachTrainInfo/ScrollStickyContent";
|
|
import { LandscapeTrainInfo } from "./EachTrainInfo/LandscapeTrainInfo";
|
|
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
|
export const EachTrainInfo = (props) => {
|
|
if (!props.payload) return <></>;
|
|
|
|
const actionSheetRef = useRef(null);
|
|
return (
|
|
<ActionSheet
|
|
gestureEnabled={true}
|
|
//gestureEnabled={!actionSheetHorizonalScroll}
|
|
CustomHeaderComponent={<></>}
|
|
ref={actionSheetRef}
|
|
drawUnderStatusBar={false}
|
|
isModal={Platform.OS == "ios"}
|
|
|
|
//useBottomSafeAreaPadding={Platform.OS == "android"}
|
|
>
|
|
<EachTrainInfoCore {...{ actionSheetRef, ...props.payload }} />
|
|
</ActionSheet>
|
|
);
|
|
};
|