From 7fc30413ad3cabc01fea248d626e31fe34ffd78f Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 28 Sep 2025 19:29:23 +0000 Subject: [PATCH] Add close button to Admin Settings --- src/components/layout/AdminHeader.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/layout/AdminHeader.tsx b/src/components/layout/AdminHeader.tsx index 68706a77..a5a342ce 100644 --- a/src/components/layout/AdminHeader.tsx +++ b/src/components/layout/AdminHeader.tsx @@ -1,22 +1,28 @@ import { Shield, ArrowLeft, Settings, RefreshCw } from 'lucide-react'; import { Button } from '@/components/ui/button'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import { ThemeToggle } from '@/components/theme/ThemeToggle'; import { AuthButtons } from '@/components/auth/AuthButtons'; import { useUserRole } from '@/hooks/useUserRole'; export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) { const { permissions } = useUserRole(); + const location = useLocation(); + + const isSettingsPage = location.pathname === '/admin/settings'; + const backLink = isSettingsPage ? '/admin' : '/'; + const backText = isSettingsPage ? 'Back to Admin' : 'Back to ThrillWiki'; + const pageTitle = isSettingsPage ? 'Admin Settings' : 'Admin Dashboard'; return (
- {/* Left Section - Back to main site */} + {/* Left Section - Navigation */}
@@ -24,7 +30,7 @@ export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) {
-

Admin Dashboard

+

{pageTitle}

@@ -39,7 +45,7 @@ export function AdminHeader({ onRefresh }: { onRefresh?: () => void }) { Refresh - {permissions?.role_level === 'superuser' && ( + {permissions?.role_level === 'superuser' && !isSettingsPage && (