jrshikoku/components/news.js
2024-03-19 09:38:20 +00:00

45 lines
1.3 KiB
JavaScript

import React from "react";
import { View, Text, TouchableOpacity } from "react-native";
import { WebView } from "react-native-webview";
import StatusbarDetect from "../StatusbarDetect";
import { AS } from "../storageControl";
import { news } from "../config/newsUpdate";
import { useNavigation } from "@react-navigation/native";
var Status = StatusbarDetect();
export default function News() {
const { navigate } = useNavigation();
return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<WebView
useWebKit={true}
source={{
uri: `https://nexcloud.haruk.in/sites/press-harukin/JRShikokuApps/${news}`,
}}
mixedContentMode={"compatibility"}
javaScriptEnabled={true}
/>
<TouchableOpacity
style={{
padding: 10,
flexDirection: "row",
borderColor: "white",
borderWidth: 1,
margin: 10,
borderRadius: 5,
alignItems: "center",
}}
onPress={() => {
AS.setItem("status", news);
navigate("Apps");
}}
>
<View style={{ flex: 1 }} />
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
更新情報を閉じる
</Text>
<View style={{ flex: 1 }} />
</TouchableOpacity>
</View>
);
}