This commit is contained in:
harukin-expo-dev-env
2025-02-05 14:15:52 +00:00
parent 9df1fc1ed2
commit f4dca5cd87
3 changed files with 65 additions and 57 deletions

28
menu.js
View File

@@ -36,6 +36,7 @@ import { useStationList } from "./stateBox/useStationList";
import { StationNumber } from "./components/Menu/StationPagination";
import lineColorList from "./assets/originData/lineColorList";
import { AS } from "./storageControl";
import { SimpleDot } from "./components/Menu/SimpleDot";
export default function Menu({ getCurrentTrain }) {
const { navigate } = useNavigation();
@@ -244,13 +245,26 @@ export default function Menu({ getCurrentTrain }) {
>
{originalStationList &&
allStationData.map((d, index) => {
return (
<StationNumber
currentStation={d}
active={index == selectedCurrentStation}
onPress={() => setSelectedCurrentStation(index)}
/>
);
const active = index == selectedCurrentStation;
const numberIndex = d[0].StationNumber;
if (dotButton) {
return (
<StationNumber
onPress={() => setSelectedCurrentStation(index)}
currentStation={d}
active={active}
index={numberIndex}
/>
);
} else {
return (
<SimpleDot
onPress={() => setSelectedCurrentStation(index)}
active={active}
index={numberIndex}
/>
);
}
})}
</View>
</View>