-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dashboard.js
42 lines (32 loc) · 1.02 KB
/
Dashboard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { useState, useEffect, useCallback } from 'react'
import { StyleSheet, View, TouchableOpacity, Alert, ScrollView } from 'react-native'
import AboutInfo from '../Components/AboutInfo';
import History from '../Components/History';
import AsyncStorage from "@react-native-async-storage/async-storage";
const Dashboard = () => {
const [userData, setUserData] = useState({});
useEffect(() => {
getUserData();
}, [])
const getUserData = useCallback(() => {
AsyncStorage.getItem("userData").then((value) => {
let parseData = JSON.parse(value);
setUserData(parseData);
});
}, [])
return (
<View style={styles.container}>
{/* <ScrollView> */}
<AboutInfo userData={userData} />
<History token={userData.token} />
{/* </ScrollView> */}
</View>
)
}
export default Dashboard
const styles = StyleSheet.create({
container:{
flex:1,
backgroundColor:'#fff'
}
})