列車アイコンを押したらアンパンマン列車運行情報ページが開くように変更
This commit is contained in:
parent
820623f2ce
commit
9465fd62cf
@ -2,9 +2,8 @@ import React, { useRef } from "react";
|
|||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import ActionSheet from "react-native-actions-sheet";
|
import ActionSheet from "react-native-actions-sheet";
|
||||||
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
||||||
export const EachTrainInfo = ({payload}) => {
|
export const EachTrainInfo = ({ payload }) => {
|
||||||
if (!payload) return <></>;
|
if (!payload) return <></>;
|
||||||
|
|
||||||
const actionSheetRef = useRef(null);
|
const actionSheetRef = useRef(null);
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
|
@ -4,6 +4,7 @@ import { Ionicons } from "@expo/vector-icons";
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useInterval } from "../../../lib/useInterval";
|
import { useInterval } from "../../../lib/useInterval";
|
||||||
import { Icon } from "@expo/vector-icons/build/createIconSet";
|
import { Icon } from "@expo/vector-icons/build/createIconSet";
|
||||||
|
import { SheetManager } from "react-native-actions-sheet";
|
||||||
|
|
||||||
type GlyphNames = ComponentProps<typeof Ionicons>["name"];
|
type GlyphNames = ComponentProps<typeof Ionicons>["name"];
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ type apt = {
|
|||||||
name: GlyphNames;
|
name: GlyphNames;
|
||||||
color: string;
|
color: string;
|
||||||
};
|
};
|
||||||
export const TrainIconStatus: FC<Props> = ({ data,navigate,from }) => {
|
export const TrainIconStatus: FC<Props> = ({ data, navigate, from }) => {
|
||||||
const [trainIcon, setTrainIcon] = useState(null);
|
const [trainIcon, setTrainIcon] = useState(null);
|
||||||
const [anpanmanStatus, setAnpanmanStatus] = useState<apt>();
|
const [anpanmanStatus, setAnpanmanStatus] = useState<apt>();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -66,7 +67,15 @@ export const TrainIconStatus: FC<Props> = ({ data,navigate,from }) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{trainIcon && (
|
{trainIcon && (
|
||||||
<View style={{}} >
|
<TouchableOpacity
|
||||||
|
onPress={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info: "https://www.jr-eki.com/aptrain/index.html",
|
||||||
|
goTo: from,
|
||||||
|
});
|
||||||
|
SheetManager.hide("EachTrainInfo");
|
||||||
|
}}
|
||||||
|
>
|
||||||
{move ? (
|
{move ? (
|
||||||
<Image
|
<Image
|
||||||
source={{ uri: trainIcon }}
|
source={{ uri: trainIcon }}
|
||||||
@ -76,7 +85,7 @@ export const TrainIconStatus: FC<Props> = ({ data,navigate,from }) => {
|
|||||||
) : (
|
) : (
|
||||||
<Ionicons {...anpanmanStatus} size={30} style={{ margin: 5 }} />
|
<Ionicons {...anpanmanStatus} size={30} style={{ margin: 5 }} />
|
||||||
)}
|
)}
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -60,7 +60,7 @@ export default function AllTrainDiagramView() {
|
|||||||
},
|
},
|
||||||
navigate,
|
navigate,
|
||||||
originalStationList,
|
originalStationList,
|
||||||
from: "AllTrainDiagramView",
|
from: "AllTrainIDList",
|
||||||
};
|
};
|
||||||
SheetManager.show("EachTrainInfo", {
|
SheetManager.show("EachTrainInfo", {
|
||||||
payload,
|
payload,
|
||||||
|
@ -40,7 +40,7 @@ export const DynamicHeaderScrollView = (props) => {
|
|||||||
}, [headerSize]);
|
}, [headerSize]);
|
||||||
const viewHeader = useMemo(() => {
|
const viewHeader = useMemo(() => {
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case "AllTrainDiagramView":
|
case "AllTrainIDList":
|
||||||
case "NearTrainDiagramView":
|
case "NearTrainDiagramView":
|
||||||
case "LED2":
|
case "LED2":
|
||||||
return true;
|
return true;
|
||||||
|
@ -37,7 +37,7 @@ export default function TrainBase({ route }) {
|
|||||||
setSupportMultipleWindows={false}
|
setSupportMultipleWindows={false}
|
||||||
onMessage={(event) => {}}
|
onMessage={(event) => {}}
|
||||||
/>
|
/>
|
||||||
{(from == "LED" || from == "LED2" || from == "AllTrainDiagramView") && (
|
{(from == "LED" || from == "LED2" || from == "AllTrainIDList") && (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
padding: 10,
|
padding: 10,
|
||||||
@ -49,7 +49,7 @@ export default function TrainBase({ route }) {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
navigate(from == "AllTrainDiagramView" ? "AllTrainIDList" : "menu")
|
navigate(from == "AllTrainIDList" ? "AllTrainIDList" : "menu")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
|
Loading…
Reference in New Issue
Block a user