|
@@ -1,19 +1,20 @@
|
|
-import React, {useEffect, useState} from 'react';
|
|
|
|
-import {Alert, Button, StyleSheet, View} from 'react-native';
|
|
|
|
-import {SafeAreaView} from 'react-native-safe-area-context';
|
|
|
|
|
|
+import React, { useEffect, useState } from 'react';
|
|
|
|
+import { Alert, Button, StyleSheet, View } from 'react-native';
|
|
|
|
+import { SafeAreaView } from 'react-native-safe-area-context';
|
|
import LinearGradient from 'react-native-linear-gradient';
|
|
import LinearGradient from 'react-native-linear-gradient';
|
|
-import {postRequest} from '@/netWork/';
|
|
|
|
-import {getStorageData, setStorageData} from '@/storage/';
|
|
|
|
-import {useLoginCom} from '@/components/useLogin';
|
|
|
|
-import {listJoinNftGroup} from '@/netWork/nft';
|
|
|
|
|
|
+import { postRequest } from '@/netWork/';
|
|
|
|
+import { getStorageData, setStorageData } from '@/storage/';
|
|
|
|
+import { useLoginCom } from '@/components/useLogin';
|
|
|
|
+import { NftGroupCard } from '@/components/nftGroupCard';
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
navigation: any;
|
|
navigation: any;
|
|
}
|
|
}
|
|
|
|
|
|
const Home = (props: Props) => {
|
|
const Home = (props: Props) => {
|
|
- const {isLogin, loading, userInfo, goTwitterAuthorize} = useLoginCom(props);
|
|
|
|
- const [nftData, setNftData] = useState({});
|
|
|
|
|
|
+ const { isLogin, loading, userInfo, goTwitterAuthorize } =
|
|
|
|
+ useLoginCom(props);
|
|
|
|
+ const [nftData, setNftData] = useState([]);
|
|
|
|
|
|
const goTwitter = () => {
|
|
const goTwitter = () => {
|
|
if (isLogin) {
|
|
if (isLogin) {
|
|
@@ -24,19 +25,21 @@ const Home = (props: Props) => {
|
|
};
|
|
};
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- isLogin &&
|
|
|
|
- listJoinNftGroup({
|
|
|
|
|
|
+ if (isLogin) {
|
|
|
|
+ postRequest('/denet/nft/group/listJoinNftGroup', {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
}).then((res: any) => {
|
|
}).then((res: any) => {
|
|
console.log('nftData', res);
|
|
console.log('nftData', res);
|
|
|
|
+ setNftData(res.data);
|
|
});
|
|
});
|
|
- }, []);
|
|
|
|
|
|
+ }
|
|
|
|
+ }, [props.navigation, isLogin]);
|
|
|
|
|
|
return (
|
|
return (
|
|
<LinearGradient
|
|
<LinearGradient
|
|
colors={['#91CAFF', '#ECF6FF', '#FFFFFF']}
|
|
colors={['#91CAFF', '#ECF6FF', '#FFFFFF']}
|
|
- style={{flex: 1}}>
|
|
|
|
|
|
+ style={{ flex: 1 }}>
|
|
<SafeAreaView style={styles.container}>
|
|
<SafeAreaView style={styles.container}>
|
|
<View style={styles.TwitterBtnWrap}>
|
|
<View style={styles.TwitterBtnWrap}>
|
|
<Button
|
|
<Button
|
|
@@ -46,6 +49,9 @@ const Home = (props: Props) => {
|
|
accessibilityLabel="go Web3 Twitter"
|
|
accessibilityLabel="go Web3 Twitter"
|
|
/>
|
|
/>
|
|
</View>
|
|
</View>
|
|
|
|
+ <View style={{ flexDirection: 'row' }}>
|
|
|
|
+ <NftGroupCard nftData={nftData} />
|
|
|
|
+ </View>
|
|
</SafeAreaView>
|
|
</SafeAreaView>
|
|
</LinearGradient>
|
|
</LinearGradient>
|
|
);
|
|
);
|