From fd9271ffd3f9677a341a07071b5c41e415cd4ea5 Mon Sep 17 00:00:00 2001 From: kikiola Date: Mon, 29 Jun 2026 16:09:57 +0100 Subject: [PATCH] refactor: integrate AppLayout into user profile page and simplify AdminLayout structure --- .../app/[locale]/profile/[address]/page.tsx | 22 ++- .../my-app/components/admin/AdminLayout.tsx | 152 +++++------------- 2 files changed, 51 insertions(+), 123 deletions(-) diff --git a/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx b/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx index 76cb7a809..2a8dd97ba 100644 --- a/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx +++ b/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx @@ -1,6 +1,7 @@ 'use client'; import { useParams } from 'next/navigation'; +import { AppLayout } from '@/components/layout/AppLayout'; import { UserProfile } from '@/components/profile/UserProfile'; import { useProfile } from '@/lib/hooks/useProfile'; @@ -8,14 +9,21 @@ export default function ProfilePage() { const params = useParams(); const address = params.address as string; - const { refetch, updateProfileData, follow, unfollow } = useProfile(address); + const { profileData, isLoading, refetch, updateProfileData, follow, unfollow } = useProfile(address); return ( - + +
+ +
+
); } diff --git a/FrontEnd/my-app/components/admin/AdminLayout.tsx b/FrontEnd/my-app/components/admin/AdminLayout.tsx index e97c46968..68dc481b2 100644 --- a/FrontEnd/my-app/components/admin/AdminLayout.tsx +++ b/FrontEnd/my-app/components/admin/AdminLayout.tsx @@ -4,6 +4,7 @@ import { useState } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import type { AdminUser } from '@/lib/types/admin'; +import { ThemeToggle } from '@/components/ui/ThemeToggle'; interface AdminLayoutProps { children: React.ReactNode; @@ -16,130 +17,49 @@ const navItems = [ { href: '/admin/quests/new', label: 'Create Quest', icon: '➕' }, { href: '/admin/submissions', label: 'Submissions', icon: '📬' }, { href: '/admin/users', label: 'Users', icon: '👥' }, - { href: '/admin/settings', label: 'Settings', icon: '⚙️' }, ]; -export function AdminLayout({ children, user }: AdminLayoutProps) { +export default function AdminLayout({ children, user }: AdminLayoutProps) { const pathname = usePathname(); - const [sidebarOpen, setSidebarOpen] = useState(false); return ( -
- {/* Mobile sidebar backdrop */} - {sidebarOpen && ( -
setSidebarOpen(false)} - /> - )} - - {/* Sidebar */} - - - {/* Main content */} -
- {/* Top bar */} -
- - -
- - Admin Panel - -
- -
- - Exit Admin - -
-
+
+ - {/* Page content */} -
{children}
+
+ {children} +
);