newsを変数管理式に変更

This commit is contained in:
harukin-DeskMini
2022-07-28 05:02:52 +09:00
parent 69de6e358a
commit 197765e7f1
3 changed files with 147 additions and 92 deletions

View File

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