refactor: 调整入口

pull/13/head
moonrailgun 4 years ago
parent 5ce2217923
commit 4970f0fd73

@ -1,17 +1,17 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { WebView } from 'react-native-webview';
import Constants from 'expo-constants';
import { AppMain } from './components/AppMain';
/**
* , expo
*/
export default function App() {
return (
<View style={styles.container}>
<StatusBar style="auto" />
<WebView
style={styles.webview}
source={{ uri: 'https://nightly.paw.msgbyte.com/' }}
/>
<AppMain />
</View>
);
}
@ -21,8 +21,4 @@ const styles = StyleSheet.create({
flex: 1,
backgroundColor: '#fff',
},
webview: {
flex: 1,
marginTop: Constants.statusBarHeight,
},
});

@ -0,0 +1,27 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import Constants from 'expo-constants';
import { WebView } from 'react-native-webview';
/**
* Tailchat
*
* webview
*/
export const AppMain: React.FC = React.memo(() => {
return (
<WebView
style={styles.webview}
source={{ uri: 'https://nightly.paw.msgbyte.com/' }}
/>
);
});
AppMain.displayName = 'AppMain';
const styles = StyleSheet.create({
webview: {
flex: 1,
marginTop: Constants.statusBarHeight,
},
});
Loading…
Cancel
Save