originalStationListの整理
This commit is contained in:
parent
f54ac90e8b
commit
4ac4c7d1c3
@ -234,7 +234,6 @@ export const EachTrainInfoCore = ({
|
|||||||
}${TrainNumber}`,
|
}${TrainNumber}`,
|
||||||
},
|
},
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
from: from == "LED" ? "LED2" : "NearTrainDiagramView",
|
from: from == "LED" ? "LED2" : "NearTrainDiagramView",
|
||||||
};
|
};
|
||||||
if (isLandscape) {
|
if (isLandscape) {
|
||||||
|
@ -23,7 +23,6 @@ export const StationDeteilView = (props) => {
|
|||||||
if (!props.payload) return <></>;
|
if (!props.payload) return <></>;
|
||||||
const {
|
const {
|
||||||
currentStation,
|
currentStation,
|
||||||
originalStationList,
|
|
||||||
navigate,
|
navigate,
|
||||||
onExit,
|
onExit,
|
||||||
goTo,
|
goTo,
|
||||||
@ -99,7 +98,6 @@ export const StationDeteilView = (props) => {
|
|||||||
>
|
>
|
||||||
<Sign
|
<Sign
|
||||||
currentStation={currentStation}
|
currentStation={currentStation}
|
||||||
originalStationList={originalStationList}
|
|
||||||
oP={() => {
|
oP={() => {
|
||||||
usePDFView == "true"
|
usePDFView == "true"
|
||||||
? Linking.openURL(currentStation[0].StationTimeTable)
|
? Linking.openURL(currentStation[0].StationTimeTable)
|
||||||
@ -114,13 +112,6 @@ export const StationDeteilView = (props) => {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{/* {currentStation &&
|
|
||||||
currentStation.map((d) => (
|
|
||||||
<NexPreStationLine
|
|
||||||
currentStation={d}
|
|
||||||
originalStationList={originalStationList}
|
|
||||||
/>
|
|
||||||
))} */}
|
|
||||||
{currentStation &&
|
{currentStation &&
|
||||||
currentStation[0].JrHpUrl &&
|
currentStation[0].JrHpUrl &&
|
||||||
currentStation[0].StationNumber != "M12" && (
|
currentStation[0].StationNumber != "M12" && (
|
||||||
|
@ -16,12 +16,11 @@ import { getStationList } from "../lib/getStationList";
|
|||||||
import { getTrainType } from "../lib/getTrainType";
|
import { getTrainType } from "../lib/getTrainType";
|
||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
import { useNavigation } from "@react-navigation/native";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
import { useTrainMenu } from "../stateBox/useTrainMenu";
|
||||||
export default function AllTrainDiagramView() {
|
export default function AllTrainDiagramView() {
|
||||||
const { navigate } = useNavigation();
|
const { navigate } = useNavigation();
|
||||||
const { allTrainDiagram } = useAllTrainDiagram();
|
const { allTrainDiagram } = useAllTrainDiagram();
|
||||||
const [originalStationList, setOriginalStationList] = useState(); // 第一要素
|
|
||||||
const [keyList, setKeyList] = useState(); // 第二要素
|
const [keyList, setKeyList] = useState(); // 第二要素
|
||||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
|
||||||
useEffect(
|
useEffect(
|
||||||
() => allTrainDiagram && setKeyList(Object.keys(allTrainDiagram)),
|
() => allTrainDiagram && setKeyList(Object.keys(allTrainDiagram)),
|
||||||
[]
|
[]
|
||||||
@ -59,7 +58,6 @@ export default function AllTrainDiagramView() {
|
|||||||
}${TrainNumber}`,
|
}${TrainNumber}`,
|
||||||
},
|
},
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
from: "AllTrainIDList",
|
from: "AllTrainIDList",
|
||||||
};
|
};
|
||||||
SheetManager.show("EachTrainInfo", {
|
SheetManager.show("EachTrainInfo", {
|
||||||
|
@ -61,7 +61,6 @@ export default function Apps() {
|
|||||||
if (returnDataBase.length) {
|
if (returnDataBase.length) {
|
||||||
const payload = {
|
const payload = {
|
||||||
currentStation: returnDataBase,
|
currentStation: returnDataBase,
|
||||||
originalStationList,
|
|
||||||
navigate,
|
navigate,
|
||||||
goTo: "Apps",
|
goTo: "Apps",
|
||||||
useShow: () => SheetManager.show("StationDetailView", { payload }),
|
useShow: () => SheetManager.show("StationDetailView", { payload }),
|
||||||
|
@ -77,7 +77,6 @@ export const AppsWebView = ({ openStationACFromEachTrainInfo }) => {
|
|||||||
if (returnDataBase.length) {
|
if (returnDataBase.length) {
|
||||||
const payload = {
|
const payload = {
|
||||||
currentStation: returnDataBase,
|
currentStation: returnDataBase,
|
||||||
originalStationList: originalStationList,
|
|
||||||
navigate: navigate,
|
navigate: navigate,
|
||||||
goTo: "Apps",
|
goTo: "Apps",
|
||||||
useShow: () =>
|
useShow: () =>
|
||||||
@ -103,7 +102,6 @@ export const AppsWebView = ({ openStationACFromEachTrainInfo }) => {
|
|||||||
const payload = {
|
const payload = {
|
||||||
data: { trainNum, limited },
|
data: { trainNum, limited },
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
};
|
};
|
||||||
SheetManager.show("EachTrainInfo", { payload });
|
SheetManager.show("EachTrainInfo", { payload });
|
||||||
|
@ -13,7 +13,7 @@ import { SheetManager } from "react-native-actions-sheet";
|
|||||||
import { AS } from "../../storageControl";
|
import { AS } from "../../storageControl";
|
||||||
import { Footer } from "./LED_Vision_Component/Footer";
|
import { Footer } from "./LED_Vision_Component/Footer";
|
||||||
import { Header } from "./LED_Vision_Component/Header";
|
import { Header } from "./LED_Vision_Component/Header";
|
||||||
|
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -50,7 +50,6 @@ export default function LED_vision(props) {
|
|||||||
trainDiagram,
|
trainDiagram,
|
||||||
getCurrentTrain,
|
getCurrentTrain,
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
} = props;
|
} = props;
|
||||||
const { currentTrain } = useCurrentTrain();
|
const { currentTrain } = useCurrentTrain();
|
||||||
@ -207,7 +206,6 @@ export default function LED_vision(props) {
|
|||||||
trainDescriptionSwitch,
|
trainDescriptionSwitch,
|
||||||
customTrainDataDetector,
|
customTrainDataDetector,
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
}}
|
}}
|
||||||
station={station[0]}
|
station={station[0]}
|
||||||
@ -235,8 +233,6 @@ export default function LED_vision(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const EachData = (props) => {
|
const EachData = (props) => {
|
||||||
const {
|
const {
|
||||||
d,
|
d,
|
||||||
@ -245,7 +241,6 @@ const EachData = (props) => {
|
|||||||
station,
|
station,
|
||||||
customTrainDataDetector,
|
customTrainDataDetector,
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
} = props;
|
} = props;
|
||||||
const { currentTrain } = useCurrentTrain();
|
const { currentTrain } = useCurrentTrain();
|
||||||
@ -265,7 +260,6 @@ const EachData = (props) => {
|
|||||||
}${TrainNumber}`,
|
}${TrainNumber}`,
|
||||||
},
|
},
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
|
||||||
openStationACFromEachTrainInfo,
|
openStationACFromEachTrainInfo,
|
||||||
from: "LED",
|
from: "LED",
|
||||||
};
|
};
|
||||||
|
@ -11,17 +11,18 @@ import { StationNameArea } from "./StationNameArea";
|
|||||||
import { StationNumberMaker } from "./StationNumberMaker";
|
import { StationNumberMaker } from "./StationNumberMaker";
|
||||||
import { NextPreStationLine } from "./NextPreStationLine";
|
import { NextPreStationLine } from "./NextPreStationLine";
|
||||||
import { LottieDelayView } from "./LottieDelayView";
|
import { LottieDelayView } from "./LottieDelayView";
|
||||||
|
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||||
|
|
||||||
export default function Sign(props) {
|
export default function Sign(props) {
|
||||||
const {
|
const {
|
||||||
currentStation,
|
currentStation,
|
||||||
originalStationList,
|
|
||||||
oP,
|
oP,
|
||||||
oLP,
|
oLP,
|
||||||
isCurrentStation = false,
|
isCurrentStation = false,
|
||||||
} = props;
|
} = props;
|
||||||
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
||||||
const [nexPrePosition, setNexPrePosition] = useState(0);
|
const [nexPrePosition, setNexPrePosition] = useState(0);
|
||||||
|
const { originalStationList} = useTrainMenu();
|
||||||
|
|
||||||
const [preStation, setPreStation] = useState();
|
const [preStation, setPreStation] = useState();
|
||||||
const [nexStation, setNexStation] = useState();
|
const [nexStation, setNexStation] = useState();
|
||||||
|
8
menu.js
8
menu.js
@ -30,10 +30,12 @@ import { useFavoriteStation } from "./stateBox/useFavoriteStation";
|
|||||||
import { SheetManager } from "react-native-actions-sheet";
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
import { useTrainDelayData } from "./stateBox/useTrainDelayData";
|
import { useTrainDelayData } from "./stateBox/useTrainDelayData";
|
||||||
import { useNavigation } from "@react-navigation/native";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
import { useTrainMenu } from "./stateBox/useTrainMenu";
|
||||||
|
|
||||||
export default function Menu({ getCurrentTrain }) {
|
export default function Menu({ getCurrentTrain }) {
|
||||||
const { navigate } = useNavigation();
|
const { navigate } = useNavigation();
|
||||||
const { favoriteStation } = useFavoriteStation();
|
const { favoriteStation } = useFavoriteStation();
|
||||||
|
const { originalStationList } = useTrainMenu();
|
||||||
|
|
||||||
//位置情報
|
//位置情報
|
||||||
const [locationStatus, setLocationStatus] = useState(null);
|
const [locationStatus, setLocationStatus] = useState(null);
|
||||||
@ -90,9 +92,6 @@ export default function Menu({ getCurrentTrain }) {
|
|||||||
|
|
||||||
const [currentStation, setCurrentStation] = useState(undefined); //第三要素
|
const [currentStation, setCurrentStation] = useState(undefined); //第三要素
|
||||||
|
|
||||||
const [originalStationList, setOriginalStationList] = useState([]); // 第一要素
|
|
||||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
|
||||||
|
|
||||||
const carouselRef = useRef();
|
const carouselRef = useRef();
|
||||||
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
||||||
|
|
||||||
@ -171,7 +170,6 @@ export default function Menu({ getCurrentTrain }) {
|
|||||||
>
|
>
|
||||||
<Sign
|
<Sign
|
||||||
currentStation={item}
|
currentStation={item}
|
||||||
originalStationList={originalStationList}
|
|
||||||
isCurrentStation={item == currentStation}
|
isCurrentStation={item == currentStation}
|
||||||
oP={() => {
|
oP={() => {
|
||||||
const payload = {
|
const payload = {
|
||||||
@ -179,7 +177,6 @@ export default function Menu({ getCurrentTrain }) {
|
|||||||
originalStationList &&
|
originalStationList &&
|
||||||
allStationData.length != 0 &&
|
allStationData.length != 0 &&
|
||||||
allStationData[selectedCurrentStation],
|
allStationData[selectedCurrentStation],
|
||||||
originalStationList: originalStationList,
|
|
||||||
navigate: navigate,
|
navigate: navigate,
|
||||||
goTo: "menu",
|
goTo: "menu",
|
||||||
useShow: () =>
|
useShow: () =>
|
||||||
@ -210,7 +207,6 @@ export default function Menu({ getCurrentTrain }) {
|
|||||||
trainDiagram={trainDiagram}
|
trainDiagram={trainDiagram}
|
||||||
getCurrentTrain={getCurrentTrain}
|
getCurrentTrain={getCurrentTrain}
|
||||||
navigate={navigate}
|
navigate={navigate}
|
||||||
originalStationList={originalStationList}
|
|
||||||
openStationACFromEachTrainInfo={() => {}}
|
openStationACFromEachTrainInfo={() => {}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -27,7 +27,7 @@ const initialState = {
|
|||||||
trainData: undefined,
|
trainData: undefined,
|
||||||
},
|
},
|
||||||
setTrainInfo: () => {},
|
setTrainInfo: () => {},
|
||||||
originalStationList: undefined,
|
originalStationList: [],
|
||||||
setOriginalStationList: () => {},
|
setOriginalStationList: () => {},
|
||||||
trainMenu: "true",
|
trainMenu: "true",
|
||||||
setTrainMenu: () => {},
|
setTrainMenu: () => {},
|
||||||
@ -61,7 +61,7 @@ export const TrainMenuProvider = ({ children }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//駅情報画面用
|
//駅情報画面用
|
||||||
const [originalStationList, setOriginalStationList] = useState();
|
const [originalStationList, setOriginalStationList] = useState([]);
|
||||||
const [trainMenu, setTrainMenu] = useState("true");
|
const [trainMenu, setTrainMenu] = useState("true");
|
||||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
useEffect(() => getStationList().then(setOriginalStationList), []);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user