-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
87 lines (82 loc) · 2.38 KB
/
App.tsx
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import * as React from "react";
import {
Text,
View,
StatusBar,
SafeAreaView,
Button,
Platform,
} from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
import {
createStackNavigator,
TransitionPresets,
} from "@react-navigation/stack";
import MaterialIcons from "react-native-vector-icons/MaterialIcons";
import { TouchableOpacity } from "react-native-gesture-handler";
import TopBarNavigator from "./src/navigation/TopBarNavigator";
import Spacing from "./src/constants/Spacing";
import Colors from "./src/constants/Colors";
import Constants from "expo-constants";
import ChatDetail from "./src/containers/1_Chat/ChatDetail";
import { useState } from "react";
import { SafeAreaProvider } from "react-native-safe-area-context";
const Stack = createStackNavigator();
const optionsTopBar = {
headerTitle: Constants.manifest.name,
headerStyle: {
backgroundColor: Colors.primary,
elevation: 0,
borderBottomWidth: 0,
},
headerTintColor: Colors.textInverted,
headerRight: () => (
<View style={{ flexDirection: "row", padding: Spacing.padding }}>
<TouchableOpacity style={{ marginEnd: Spacing.padding }}>
<MaterialIcons
name={"search"}
size={Spacing.icon_AppBar}
color={Colors.textInverted}
/>
</TouchableOpacity>
<TouchableOpacity>
<MaterialIcons
name={"more-vert"}
size={Spacing.icon_AppBar}
color={Colors.textInverted}
/>
</TouchableOpacity>
</View>
),
};
export default function App() {
const [count, setCount] = useState(0);
function handleAlertClick() {
console.log("clicked");
setTimeout(() => {
alert("You clicked on: " + count);
}, 3000);
}
return (
<SafeAreaProvider>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
options={optionsTopBar}
name="Root"
component={TopBarNavigator}
/>
<Stack.Screen
name="ChatDetail"
component={ChatDetail}
options={{
...TransitionPresets.SlideFromRightIOS,
}}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaProvider>
);
}