|
@@ -1,9 +1,8 @@
|
|
-import React, { useEffect, useState } from 'react';
|
|
|
|
-import { Alert, Button, StyleSheet, View } from 'react-native';
|
|
|
|
|
|
+import React, { useEffect, useState, useRef } from 'react';
|
|
|
|
+import { Text, StyleSheet, Image, View, ImageBackground, Pressable, Animated } from 'react-native';
|
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
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 { postRequest } from '@/netWork/';
|
|
-import { getStorageData, setStorageData } from '@/storage/';
|
|
|
|
import { useLoginCom } from '@/components/useLogin';
|
|
import { useLoginCom } from '@/components/useLogin';
|
|
import { NftGroupCard } from '@/components/nftGroupCard';
|
|
import { NftGroupCard } from '@/components/nftGroupCard';
|
|
|
|
|
|
@@ -12,10 +11,9 @@ interface Props {
|
|
}
|
|
}
|
|
|
|
|
|
const Home = (props: Props) => {
|
|
const Home = (props: Props) => {
|
|
- const { isLogin, loading, userInfo, goTwitterAuthorize } =
|
|
|
|
- useLoginCom(props);
|
|
|
|
|
|
+ const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
|
|
+ const { isLogin, goTwitterAuthorize } = useLoginCom(props);
|
|
const [nftData, setNftData] = useState([]);
|
|
const [nftData, setNftData] = useState([]);
|
|
-
|
|
|
|
const goTwitter = () => {
|
|
const goTwitter = () => {
|
|
if (isLogin) {
|
|
if (isLogin) {
|
|
props.navigation.navigate('Twitter');
|
|
props.navigation.navigate('Twitter');
|
|
@@ -41,14 +39,25 @@ const Home = (props: Props) => {
|
|
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}>
|
|
|
|
- <Button
|
|
|
|
- onPress={goTwitter}
|
|
|
|
- title="Web3 Twitter"
|
|
|
|
- color="#841584"
|
|
|
|
- accessibilityLabel="go Web3 Twitter"
|
|
|
|
|
|
+ <View style={styles.denetWrap}>
|
|
|
|
+ <Image
|
|
|
|
+ style={styles.denet}
|
|
|
|
+ source={ require('../../static/img/home/welcome.png') }
|
|
/>
|
|
/>
|
|
|
|
+ <ImageBackground
|
|
|
|
+ style={styles.goods}
|
|
|
|
+ source={ require('../../static/img/home/goods.png') }>
|
|
|
|
+ </ImageBackground>
|
|
</View>
|
|
</View>
|
|
|
|
+ <Pressable style={styles.TwitterBtnWrap} onPress={goTwitter}>
|
|
|
|
+ <View style={styles.TwitterLayer}>
|
|
|
|
+ <Image
|
|
|
|
+ style={styles.twitterIcon}
|
|
|
|
+ source={ require('../../static/img/home/twritter.png') }
|
|
|
|
+ />
|
|
|
|
+ <Text style={styles.twitterFont}>Web3 Twitter</Text>
|
|
|
|
+ </View>
|
|
|
|
+ </Pressable>
|
|
<View style={{ flexDirection: 'row' }}>
|
|
<View style={{ flexDirection: 'row' }}>
|
|
<NftGroupCard nftData={nftData} />
|
|
<NftGroupCard nftData={nftData} />
|
|
</View>
|
|
</View>
|
|
@@ -60,13 +69,48 @@ const Home = (props: Props) => {
|
|
const styles = StyleSheet.create({
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
container: {
|
|
flex: 1,
|
|
flex: 1,
|
|
|
|
+ },
|
|
|
|
+ denetWrap: {
|
|
|
|
+ flexDirection: 'row',
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
- paddingTop: 180,
|
|
|
|
|
|
+ height: 280,
|
|
|
|
+ paddingLeft: 16,
|
|
|
|
+ paddingRight: 16,
|
|
|
|
+ },
|
|
|
|
+ denet: {
|
|
|
|
+ width: 178,
|
|
|
|
+ height: 120,
|
|
|
|
+ },
|
|
|
|
+ goods: {
|
|
|
|
+ width: 180,
|
|
|
|
+ height: 280,
|
|
},
|
|
},
|
|
TwitterBtnWrap: {
|
|
TwitterBtnWrap: {
|
|
- width: 343,
|
|
|
|
|
|
+ paddingLeft: 16,
|
|
|
|
+ paddingRight: 16,
|
|
|
|
+ textAlign: 'left',
|
|
|
|
+ },
|
|
|
|
+ TwitterLayer: {
|
|
|
|
+ display: 'flex',
|
|
|
|
+ alignItems: 'center',
|
|
|
|
+ justifyContent: 'center',
|
|
|
|
+ flexDirection: 'row',
|
|
|
|
+ height: 64,
|
|
|
|
+ paddingLeft: 20,
|
|
|
|
+ paddingRight: 20,
|
|
|
|
+ borderRadius: 10,
|
|
backgroundColor: '#fff',
|
|
backgroundColor: '#fff',
|
|
},
|
|
},
|
|
|
|
+ twitterIcon: {
|
|
|
|
+ width: 40,
|
|
|
|
+ height: 40,
|
|
|
|
+ borderRadius: 4,
|
|
|
|
+ marginRight: 20,
|
|
|
|
+ },
|
|
|
|
+ twitterFont: {
|
|
|
|
+ flex: 1,
|
|
|
|
+ fontSize: 16,
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
|
|
export default Home;
|
|
export default Home;
|