46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import React from "react";
|
|
import { View, StyleSheet } from "react-native";
|
|
import { WebView } from "react-native-webview";
|
|
import { BigButton } from "./components/atom/BigButton";
|
|
import { useNavigation } from "@react-navigation/native";
|
|
import { useThemeColors } from "@/lib/theme";
|
|
|
|
type RouteParams = {
|
|
info: string;
|
|
goTo?: string;
|
|
useShow?: () => void;
|
|
};
|
|
|
|
type Props = {
|
|
navigation: { navigate: (screen: string) => void };
|
|
route: { params?: RouteParams };
|
|
};
|
|
|
|
export default ({ navigation: { navigate }, route }: Props) => {
|
|
if (!route.params) {
|
|
return null
|
|
}
|
|
const { info, goTo, useShow } = route.params;
|
|
const { goBack } = useNavigation();
|
|
const { fixed } = useThemeColors();
|
|
const onExit = () => {
|
|
if (goTo != "NearTrainDiagramView") {
|
|
//navigate(goTo || "Apps");
|
|
useShow && useShow();
|
|
}
|
|
goBack();
|
|
};
|
|
return (
|
|
<View style={{ height: "100%", backgroundColor: fixed.primary }}>
|
|
<WebView
|
|
useWebKit
|
|
contentMode="mobile"
|
|
source={{ uri: info.replace("http://", "https://") }}
|
|
/>
|
|
<BigButton onPress={onExit} string="閉じる" />
|
|
</View>
|
|
);
|
|
};
|
|
|
|
|