39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
const WEBVIEW = "WEBVIEW";
|
|
import React, { Component } from "react";
|
|
import { StatusBar, View, TouchableOpacity, Text } from "react-native";
|
|
import { WebView } from "react-native-webview";
|
|
export default ({ navigation: { navigate }, route }) => {
|
|
const { info, goTo, useShow } = route.params;
|
|
const onExit = () => {
|
|
navigate(goTo);
|
|
useShow();
|
|
};
|
|
return (
|
|
<View style={styles.View}>
|
|
<WebView
|
|
useWebKit
|
|
source={{ uri: info.replace("http://", "https://") }}
|
|
/>
|
|
<TouchableOpacity style={styles.touch} onPress={onExit}>
|
|
<View style={{ flex: 1 }} />
|
|
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
|
閉じる
|
|
</Text>
|
|
<View style={{ flex: 1 }} />
|
|
</TouchableOpacity>
|
|
</View>
|
|
);
|
|
};
|
|
const styles = {
|
|
View: { height: "100%", backgroundColor: "#0099CC" },
|
|
touch: {
|
|
padding: 10,
|
|
flexDirection: "row",
|
|
borderColor: "white",
|
|
borderWidth: 1,
|
|
margin: 10,
|
|
borderRadius: 5,
|
|
alignItems: "center",
|
|
},
|
|
};
|