ファイルの分離
This commit is contained in:
40
menu.js
40
menu.js
@@ -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>
|
||||
);
|
||||
|
Reference in New Issue
Block a user