2021-03-16 17:00:55 +07:00
|
|
|
import { StatusBar } from 'expo-status-bar';
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
|
|
|
import { Alert, Button, Image, StyleSheet, Dimensions, SafeAreaView, ScrollView, TouchableOpacity } from 'react-native';
|
|
|
|
|
import { Header, MainSeach } from './components/header/headerMain';
|
|
|
|
|
|
|
|
|
|
import useCachedResources from './hooks/useCachedResources';
|
|
|
|
|
import useColorScheme from './hooks/useColorScheme';
|
|
|
|
|
import Navigation from './navigation';
|
|
|
|
|
import { createDrawerNavigator, DrawerItemList, DrawerItem, DrawerContentScrollView } from '@react-navigation/drawer';
|
|
|
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
|
|
|
import { createStackNavigator, StackScreenProps } from '@react-navigation/stack';
|
|
|
|
|
import { Text, View, } from './components/Themed';
|
|
|
|
|
import TabOneScreen from './screens/TabOneScreen';
|
|
|
|
|
import TabTwoScreen from './screens/TabTwoScreen';
|
|
|
|
|
import ProductDetail from './screens/ProductDetail';
|
|
|
|
|
import CartDetail from './screens/Cart';
|
2021-03-17 16:50:37 +07:00
|
|
|
import ArticleHome from './screens/ArticleHome';
|
|
|
|
|
import ArticleList from './screens/ArticleList';
|
2021-03-18 17:51:32 +07:00
|
|
|
import ArticleDetail from './screens/ArticleDetail';
|
|
|
|
|
import Login from './screens/Login';
|
|
|
|
|
import Register from './screens/Register';
|
|
|
|
|
import ForgetPassword from './screens/ForgetPassword';
|
|
|
|
|
import AboutUs from './screens/AboutUs';
|
|
|
|
|
import ContactUs from './screens/ContactUs';
|
|
|
|
|
import BuildPc from './screens/BuildPc';
|
2021-03-19 17:43:53 +07:00
|
|
|
import AccountHome from './screens/AccountHome';
|
2021-03-24 10:19:30 +07:00
|
|
|
import SearchProduct from './screens/SearchProduct';
|
|
|
|
|
import { FontAwesome } from '@expo/vector-icons';
|
2021-03-18 17:51:32 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-16 17:00:55 +07:00
|
|
|
|
|
|
|
|
export default function App() {
|
|
|
|
|
const isLoadingComplete = useCachedResources();
|
|
|
|
|
const colorScheme = useColorScheme();
|
|
|
|
|
|
|
|
|
|
if (!isLoadingComplete) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
return (
|
|
|
|
|
<NavigationContainer>
|
2021-03-24 10:19:30 +07:00
|
|
|
<AllPage />
|
2021-03-16 17:00:55 +07:00
|
|
|
</NavigationContainer>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Drawer = createDrawerNavigator();
|
|
|
|
|
const Stack = createStackNavigator();
|
|
|
|
|
|
|
|
|
|
/* cài đặt thông số cho header */
|
|
|
|
|
const HeaderAllPageOpion = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
{
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<Header props={navigation} />
|
|
|
|
|
),
|
|
|
|
|
headerTitle: () => (
|
|
|
|
|
<Text></Text>
|
|
|
|
|
),
|
|
|
|
|
headerStyle: {
|
|
|
|
|
backgroundColor: '#3385ff',
|
|
|
|
|
height: 130,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* redirect về trang chủ */
|
2021-03-24 10:19:30 +07:00
|
|
|
const HomePage = () => {
|
2021-03-16 17:00:55 +07:00
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="homepage"
|
|
|
|
|
component={TabOneScreen}
|
|
|
|
|
options={HeaderAllPageOpion}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-24 10:19:30 +07:00
|
|
|
|
|
|
|
|
|
2021-03-16 17:00:55 +07:00
|
|
|
/* redirect về danh mục */
|
|
|
|
|
const ProductList = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="productlist"
|
2021-03-16 17:00:55 +07:00
|
|
|
component={TabTwoScreen}
|
|
|
|
|
options={HeaderAllPageOpion}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ProductDetailRec = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
2021-03-24 10:19:30 +07:00
|
|
|
<Stack.Navigator initialRouteName="ProductDetail">
|
2021-03-16 17:00:55 +07:00
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="ProductDetail"
|
2021-03-16 17:00:55 +07:00
|
|
|
component={ProductDetail}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Danh sách sản phẩm',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-16 17:00:55 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CartPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="cart"
|
2021-03-16 17:00:55 +07:00
|
|
|
component={CartDetail}
|
|
|
|
|
options={HeaderAllPageOpion}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-17 16:50:37 +07:00
|
|
|
const ArticleHomePage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="articlehome"
|
2021-03-17 16:50:37 +07:00
|
|
|
component={ArticleHome}
|
|
|
|
|
options={HeaderAllPageOpion}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ArticleListPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="articlelist"
|
2021-03-17 16:50:37 +07:00
|
|
|
component={ArticleList}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Danh mục Tin tức',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-17 16:50:37 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-18 17:51:32 +07:00
|
|
|
const ArticleDetailPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="articledetail"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={ArticleDetail}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Chi tiết tin tức',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const LoginPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="login"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={Login}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Đăng nhập',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const RegisterPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="register"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={Register}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Đăng ký',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ForgetPasswordPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="forgetpassword"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={ForgetPassword}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Quên mật khẩu',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const AboutUsPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="aboutus"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={AboutUs}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Giới thiệu',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ContactUsPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="contactus"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={ContactUs}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Liên hệ',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const BuildPcPage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="buildpc"
|
2021-03-18 17:51:32 +07:00
|
|
|
component={BuildPc}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Xây dựng cấu hình',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-18 17:51:32 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-19 17:43:53 +07:00
|
|
|
const AccountHomePage = ({ navigation }: { navigation: any }) => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
<Stack.Screen
|
2021-03-24 10:19:30 +07:00
|
|
|
name="accounthome"
|
2021-03-19 17:43:53 +07:00
|
|
|
component={AccountHome}
|
2021-03-24 10:19:30 +07:00
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Tài khoản',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
2021-03-19 17:43:53 +07:00
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-24 10:19:30 +07:00
|
|
|
const AllPage = () => {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator initialRouteName="homepage">
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="homepage"
|
|
|
|
|
component={MainContentRouter}
|
|
|
|
|
options={{ headerShown: false }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="productlist"
|
|
|
|
|
component={TabTwoScreen}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Danh mục sản phẩm',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="ProductDetail"
|
|
|
|
|
component={ProductDetail}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Chi tiết sản phẩm',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="cart"
|
|
|
|
|
component={CartDetail}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Giỏ hàng',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="articlehome"
|
|
|
|
|
component={ArticleHome}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Tin tức',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="articlelist"
|
|
|
|
|
component={ArticleList}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Danh sách tin tức',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="articledetail"
|
|
|
|
|
component={ArticleDetail}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Chi tiết tin tức',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="login"
|
|
|
|
|
component={Login}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Đăng nhập',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="register"
|
|
|
|
|
component={Register}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Đăng ký',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="forgetpassword"
|
|
|
|
|
component={ForgetPassword}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Quên mật khẩu',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="aboutus"
|
|
|
|
|
component={AboutUs}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Giới thiệu',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="contactus"
|
|
|
|
|
component={ContactUs}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Liên hệ',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="buildpc"
|
|
|
|
|
component={BuildPc}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Xây dựng cấu hình',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="accounthome"
|
|
|
|
|
component={AccountHome}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Tài khoản',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="search"
|
|
|
|
|
component={SearchProduct}
|
|
|
|
|
options={({ navigation }) => ({
|
|
|
|
|
headerTitle: 'Tìm kiếm',
|
|
|
|
|
headerLeft: () => (
|
|
|
|
|
<TouchableOpacity style={styles.buttonGoBack} onPress={() => navigation.goBack()}>
|
|
|
|
|
<FontAwesome style={styles.buttonGoBackIcon} name="angle-left" />
|
|
|
|
|
<Text style={styles.buttonGoBackText}>Quay lại</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-03-16 17:00:55 +07:00
|
|
|
const MainContentRouter = () => {
|
|
|
|
|
return (
|
2021-03-24 10:19:30 +07:00
|
|
|
<Drawer.Navigator initialRouteName="Trang chủ">
|
|
|
|
|
<Drawer.Screen name="Trang chủ" component={HomePage} />
|
|
|
|
|
<Drawer.Screen name="Giới thiệu" component={AboutUsPage} />
|
2021-03-16 17:00:55 +07:00
|
|
|
<Drawer.Screen name="Laptop, Máy Tính Xách Tay" component={ProductList} />
|
2021-03-17 16:50:37 +07:00
|
|
|
<Drawer.Screen name="Tin tức" component={ArticleHomePage} />
|
|
|
|
|
<Drawer.Screen name="Tin khuyến mại" component={ArticleListPage} />
|
2021-03-18 17:51:32 +07:00
|
|
|
<Drawer.Screen name="Đăng nhập" component={LoginPage} />
|
|
|
|
|
<Drawer.Screen name="Đăng Ký" component={RegisterPage} />
|
|
|
|
|
<Drawer.Screen name="Xây dựng cấu hình" component={BuildPcPage} />
|
2021-03-19 17:43:53 +07:00
|
|
|
<Drawer.Screen name="Tài khoản" component={AccountHomePage} />
|
2021-03-24 10:19:30 +07:00
|
|
|
<Drawer.Screen name="Liên hệ" component={ContactUsPage} />
|
2021-03-16 17:00:55 +07:00
|
|
|
</Drawer.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-24 10:19:30 +07:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
buttonGoBack: {
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
paddingLeft: 10,
|
|
|
|
|
},
|
|
|
|
|
buttonGoBackText: {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
},
|
|
|
|
|
buttonGoBackIcon: {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
marginRight: 10,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|