-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.js
69 lines (63 loc) · 2.13 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
import React, { useEffect } from "react";
import { View, TouchableOpacity, Text, Image, StyleSheet } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { FontAwesome } from '@expo/vector-icons';
import colors from '../colors';
import { Entypo } from '@expo/vector-icons';
const catImageUrl = "https://i.guim.co.uk/img/media/26392d05302e02f7bf4eb143bb84c8097d09144b/446_167_3683_2210/master/3683.jpg?width=1200&height=1200&quality=85&auto=format&fit=crop&s=49ed3252c0b2ffb49cf8b508892e452d";
const Home = () => {
const navigation = useNavigation();
useEffect(() => {
navigation.setOptions({
headerLeft: () => (
<FontAwesome name="search" size={24} color={colors.gray} style={{marginLeft: 15}}/>
),
headerRight: () => (
<Image
source={{ uri: catImageUrl }}
style={{
width: 40,
height: 40,
marginRight: 15,
}}
/>
),
});
}, [navigation]);
return (
<View style={styles.container}>
<TouchableOpacity
onPress={() => navigation.navigate("Chat")}
style={styles.chatButton}
>
<Entypo name="chat" size={24} color={colors.lightGray} />
</TouchableOpacity>
</View>
);
};
export default Home;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'flex-end',
backgroundColor: "#fff",
},
chatButton: {
backgroundColor: colors.primary,
height: 50,
width: 50,
borderRadius: 25,
alignItems: 'center',
justifyContent: 'center',
shadowColor: colors.primary,
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: .9,
shadowRadius: 8,
marginRight: 20,
marginBottom: 50,
}
});