Replace SVGs with icons, restructure the table for CRUD operations across the project, standardize the application's display, and build a new template for the table's action buttons.
This commit is contained in:
@@ -8,16 +8,11 @@ import Navbar from "./Navbar";
|
||||
export default function ConditionalNavbar() {
|
||||
const pathname = usePathname();
|
||||
|
||||
// استبدلنا getStoredUser() المباشر بالـ hook عشان يبقى SSR-safe
|
||||
const { user, loading } = useStoredUser();
|
||||
|
||||
// لحد ما نتأكد من حالة تسجيل الدخول من الـ storage، منوريش/مخفيش
|
||||
// الناف بار عشان نتجنب وميض (flash) قبل الـ hydration يخلص. مفيش
|
||||
// حاجة تتعرض هنا أصلاً (مفيش avatar/اسم في الناف بار العام)، فـ null
|
||||
// كافية ومفيش داعي لـ Spinner/InlineLoader في المكان ده.
|
||||
|
||||
if (loading) return null;
|
||||
|
||||
// لو المستخدم مسجل دخول، أو الصفحة الحالية جوه الداشبورد، منظهرش الناف بار العام
|
||||
const isDashboardRoute = pathname?.startsWith("/dashboard");
|
||||
if (user || isDashboardRoute) return null;
|
||||
|
||||
|
||||
@@ -288,17 +288,7 @@ export function Sidebar() {
|
||||
color: "#fff",
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2.5"
|
||||
strokeLinecap="round"
|
||||
>
|
||||
<path d="M18 6 6 18M6 6l12 12" />
|
||||
</svg>
|
||||
<i className="ti ti-x" style={{ fontSize: 13 }} aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<SidebarContent
|
||||
|
||||
@@ -11,9 +11,6 @@ export function Topbar() {
|
||||
const router = useRouter();
|
||||
const { setOpen } = useSidebarDrawer();
|
||||
|
||||
// كان بيتقرأ بشكل sync عن طريق getStoredUser() جوه الرندر — استبدلناه بالـ hook
|
||||
// عشان يبقى SSR-safe ومايعملش hydration mismatch، وكمان يعمل subscribe
|
||||
// لأي تغيير في الـ storage (تسجيل دخول/خروج من تاب تاني).
|
||||
const { user, loading } = useStoredUser();
|
||||
|
||||
async function handleLogout() {
|
||||
|
||||
Reference in New Issue
Block a user