-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHome.js
70 lines (63 loc) · 1.64 KB
/
Home.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/** @format */
import React, { useEffect } from 'react';
import { View, StyleSheet } from 'react-native';
import { logout } from './reduxBase/actions/userAction';
import { useDispatch, useSelector } from 'react-redux';
import { Text, Button } from 'native-base';
import { getPurch } from './reduxBase/actions/dataAction';
const Home = ({ navigation }) => {
const dispatch = useDispatch();
const user = useSelector((state) => state.user.user);
const handleLogout = async () => {
dispatch(logout());
};
useEffect(() => {
dispatch(getPurch(user));
}, [dispatch]);
return (
<View style={styles.container}>
<View style={styles.inputsContainer}>
<Text fontSize='md' color='coolGray.200'>
Halo {user}
</Text>
<Text fontSize={25} mb={5} color='coolGray.200'>
Selamat Datang di Augmented Management System
</Text>
<Text fontSize={10} mb={5} color='coolGray.200'>
Dari sini Anda dapat mengelola atau memvisualisasikan untuk melacak data Anda
</Text>
<Button variant='outline' onPress={handleLogout}>
Sign Out
</Button>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: '#111827',
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},
inputsContainer: {
borderWidth: 0.5,
borderColor: '#4b5563',
borderRadius: 10,
paddingTop: 20,
paddingBottom: 20,
paddingLeft: 30,
paddingRight: 30,
backgroundColor: '#1f2937',
display: 'flex',
alignItems: 'center',
width: '85%',
shadowColor: 'white',
shadowOffset: { width: 5, height: 5 },
shadowOpacity: 0.2,
shadowRadius: 6,
elevation: 2,
marginBottom: 10
}
});
export default Home;