Add pages

This commit is contained in:
2025-09-17 12:16:50 +07:00
parent bc60728369
commit 291cbd5f94
12 changed files with 2012 additions and 0 deletions

52
src/pages/home/Home.jsx Normal file
View File

@@ -0,0 +1,52 @@
import { useEffect, useState } from 'react';
import { Card, Typography, Flex } from 'antd';
import { useBreadcrumb } from '../../layout/LayoutBreadcrumb';
const { Text } = Typography;
const Home = () => {
const { setBreadcrumbItems } = useBreadcrumb();
const [isMobile, setIsMobile] = useState(window.innerWidth <= 768);
useEffect(() => {
const handleResize = () => {
setIsMobile(window.innerWidth <= 768);
};
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
useEffect(() => {
const token = localStorage.getItem('token');
if (token) {
setBreadcrumbItems([
{
title: (
<Text strong style={{ fontSize: '14px' }}>
Dashboard
</Text>
),
},
{
title: (
<Text strong style={{ fontSize: '14px' }}>
Home
</Text>
),
},
]);
} else {
navigate('/signin');
}
}, []);
return (
<Card>
<Flex align="center" justify="center">
<Text strong style={{fontSize:'30px'}}>Wellcome Call Of Duty App</Text>
</Flex>
</Card>
);
};
export default Home;