1
0

update the dashbord and router

هذا الالتزام موجود في:
raghad
2025-05-19 12:53:59 +03:00
الأصل 9b0d90560e
التزام aacc58c4a6
110 ملفات معدلة مع 6404 إضافات و44 حذوفات

37
src/test.js Normal file
عرض الملف

@@ -0,0 +1,37 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { useTheme } from '@mui/material/styles';
import { Box, Typography } from '@mui/material';
const Test = () => { // لاحظ الحرف الكبير في بداية الاسم
const navigate = useNavigate(); // صحيح الآن لأنها داخل مكون React
const theme = useTheme(); // تعريف theme باستخدام useTheme
const handleClick = () => {
navigate('/dashboard');
};
return (
<Box sx={{
backgroundColor: theme.palette.background.default,
p: 2
}}>
<Typography
variant="h6"
sx={{
color: theme.palette.text.primary,
mb: 2,
fontWeight:900,
fontSize:'50px'
}}
>
Test Component
</Typography>
<button onClick={handleClick}>
Navigate
</button>
</Box>
);
};
export default Test;