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';
import ArticleHome from './screens/ArticleHome';
import ArticleList from './screens/ArticleList';
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';
import AccountHome from './screens/AccountHome';
import SearchProduct from './screens/SearchProduct';
import { FontAwesome } from '@expo/vector-icons';
export default function App() {
const isLoadingComplete = useCachedResources();
const colorScheme = useColorScheme();
if (!isLoadingComplete) {
return null;
} else {
return (
);
}
}
const Drawer = createDrawerNavigator();
const Stack = createStackNavigator();
/* cài đặt thông số cho header */
const HeaderAllPageOpion = ({ navigation }: { navigation: any }) => {
return (
{
headerLeft: () => (
),
headerTitle: () => (
),
headerStyle: {
backgroundColor: '#3385ff',
height: 130,
}
}
)
}
/* redirect về trang chủ */
const HomePage = () => {
return (
);
}
/* redirect về danh mục */
const ProductList = ({ navigation }: { navigation: any }) => {
return (
);
}
const ProductDetailRec = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Danh sách sản phẩm',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const CartPage = ({ navigation }: { navigation: any }) => {
return (
);
}
const ArticleHomePage = ({ navigation }: { navigation: any }) => {
return (
);
}
const ArticleListPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Danh mục Tin tức',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const ArticleDetailPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Chi tiết tin tức',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const LoginPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Đăng nhập',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const RegisterPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Đăng ký',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const ForgetPasswordPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Quên mật khẩu',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const AboutUsPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Giới thiệu',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const ContactUsPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Liên hệ',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const BuildPcPage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Xây dựng cấu hình',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const AccountHomePage = ({ navigation }: { navigation: any }) => {
return (
({
headerTitle: 'Tài khoản',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
);
}
const AllPage = () => {
return (
({
headerTitle: 'Danh mục sản phẩm',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Chi tiết sản phẩm',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Giỏ hàng',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Tin tức',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Danh sách tin tức',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Chi tiết tin tức',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Đăng nhập',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Đăng ký',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Quên mật khẩu',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Giới thiệu',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Liên hệ',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Xây dựng cấu hình',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Tài khoản',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
({
headerTitle: 'Tìm kiếm',
headerLeft: () => (
navigation.goBack()}>
Quay lại
),
})}
/>
)
}
const MainContentRouter = () => {
return (
);
}
const styles = StyleSheet.create({
buttonGoBack: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 10,
},
buttonGoBackText: {
fontSize: 16,
},
buttonGoBackIcon: {
fontSize: 16,
marginRight: 10,
},
})