調整
This commit is contained in:
parent
e04cfb9a8b
commit
1a1e9c417b
@ -9,6 +9,7 @@ import {
|
||||
import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
|
||||
import lineColorList from "../../assets/originData/lineColorList";
|
||||
import { stationIDPair } from "../../lib/getStationList2";
|
||||
import { lineListPair } from "../../lib/getStationList";
|
||||
@ -19,6 +20,7 @@ export const TrainMenuLineSelector = () => {
|
||||
setSelectedLine,
|
||||
mapsStationData: stationData,
|
||||
} = useTrainMenu();
|
||||
const { webview } = useCurrentTrain();
|
||||
const actionSheetRef = useRef(null);
|
||||
const insets = useSafeAreaInsets();
|
||||
const platformIs = Platform.OS == "android";
|
||||
@ -52,7 +54,25 @@ export const TrainMenuLineSelector = () => {
|
||||
}}
|
||||
onPress={() => {
|
||||
SheetManager.hide("TrainMenuLineSelector");
|
||||
setSelectedLine(selectedLine == d ? undefined : d);
|
||||
const s = selectedLine == d ? undefined : d;
|
||||
if(!s) return;
|
||||
setSelectedLine(s);
|
||||
Object.keys(stationData).forEach((data, indexBase) => {
|
||||
stationData[data].forEach((D, index) => {
|
||||
if (!D.StationMap) return null;
|
||||
if (s && s != data) return;
|
||||
const latlng = D.StationMap.replace(
|
||||
"https://www.google.co.jp/maps/place/",
|
||||
""
|
||||
).split(",");
|
||||
if (latlng.length == 0) return null;
|
||||
if (index == 0 ) {
|
||||
webview.current
|
||||
?.injectJavaScript(`MoveDisplayStation('${data}_${D.MyStation}_${D.Station_JP}');
|
||||
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
<View
|
||||
|
@ -147,6 +147,7 @@ export default function TrainMenu({ style }) {
|
||||
}}
|
||||
onPress={() => {
|
||||
const s = selectedLine == d ? undefined : d;
|
||||
if(!s) return;
|
||||
setSelectedLine(s);
|
||||
Object.keys(stationData).forEach((data, indexBase) => {
|
||||
stationData[data].forEach((D, index) => {
|
||||
|
Loading…
Reference in New Issue
Block a user