my changes

This commit is contained in:
2026-01-09 00:07:39 +03:00
parent 6420af403a
commit 7ad7dff0da
24 changed files with 2345 additions and 727 deletions

View File

@ -0,0 +1,22 @@
// AnimatedRoutes.jsx
import React from "react";
import { Routes, Route, useLocation } from "react-router-dom";
import { AnimatePresence, LayoutGroup } from "framer-motion";
import Departments from "./Departments";
import DepartmentDetail from "./DepartmentDetail";
export default function AnimatedRoutes() {
const location = useLocation();
return (
<LayoutGroup>
<AnimatePresence mode="wait">
{/* key مهم حتى يعمل خروج/دخول الصفحة مع الانتقال */}
<Routes location={location} key={location.pathname}>
<Route path="/" element={<Departments />} />
<Route path="/departments/1" element={<DepartmentDetail />} />
</Routes>
</AnimatePresence>
</LayoutGroup>
);
}