ファイルの分離

This commit is contained in:
harukin-expo-dev-env
2024-09-09 10:41:18 +00:00
parent 30662ab10c
commit ad98372df8
17 changed files with 181 additions and 170 deletions

40
menu.js
View File

@@ -137,6 +137,21 @@ export default function Menu({ getCurrentTrain }) {
setTrainDiagram(trainList);
});
}, []);
const oPSign = () => {
const payload = {
currentStation:
originalStationList &&
allStationData.length != 0 &&
allStationData[selectedCurrentStation],
navigate: navigate,
goTo: "menu",
useShow: () => SheetManager.show("StationDetailView", { payload }),
onExit: () => SheetManager.hide("StationDetailView"),
};
SheetManager.show("StationDetailView", { payload });
};
return (
<View
style={{
@@ -159,9 +174,7 @@ export default function Menu({ getCurrentTrain }) {
enableMomentum
callbackOffsetMargin={1000}
activeAnimationOptions={0.3}
onSnapToItem={(d) => {
setSelectedCurrentStation(d);
}}
onSnapToItem={setSelectedCurrentStation}
renderItem={({ item }) => {
return (
<View
@@ -171,26 +184,7 @@ export default function Menu({ getCurrentTrain }) {
<Sign
currentStation={item}
isCurrentStation={item == currentStation}
oP={() => {
const payload = {
currentStation:
originalStationList &&
allStationData.length != 0 &&
allStationData[selectedCurrentStation],
navigate: navigate,
goTo: "menu",
useShow: () =>
SheetManager.show("StationDetailView", {
payload,
}),
onExit: () => {
SheetManager.hide("StationDetailView");
},
};
SheetManager.show("StationDetailView", {
payload,
});
}}
oP={oPSign}
/>
</View>
);