|
@@ -1,12 +1,36 @@
|
|
|
-import React from 'react';
|
|
|
-import { Text, View } from 'react-native';
|
|
|
-
|
|
|
-const Message = () => {
|
|
|
- return (
|
|
|
- <View style={{ flex: 1 }}>
|
|
|
- <Text>Message page</Text>
|
|
|
- </View>
|
|
|
- );
|
|
|
+import React, { Component } from 'react';
|
|
|
+import { LoginView } from '@/components/loginView';
|
|
|
+import { DenetWebview } from '@/components/webview';
|
|
|
+import { useLoginCom } from '@/components/useLogin';
|
|
|
+
|
|
|
+interface Props {
|
|
|
+ navigation: any;
|
|
|
+}
|
|
|
+
|
|
|
+const onMessage = async (event: any) => {
|
|
|
+ let { info, data } = (event.nativeEvent.data && JSON.parse(event.nativeEvent.data)) || {};
|
|
|
+ switch (info.actionType) {
|
|
|
+ case 'IFRAME_GET_EXTENSION_STORGE_DATA':
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const Message = (props: Props) => {
|
|
|
+ const { isLogin, goTwitterAuthorize } = useLoginCom(props);
|
|
|
+
|
|
|
+ if (isLogin === false) {
|
|
|
+ return (
|
|
|
+ <LoginView></LoginView>
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return (
|
|
|
+ <DenetWebview
|
|
|
+ onMessageHandle={onMessage}
|
|
|
+ uri="http://localhost:3000/nav-message?iframeID=de-nav-message-page&appVersionCode=23">
|
|
|
+ </DenetWebview>
|
|
|
+ );
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
export default Message;
|