feat: enhance layout and sidebar functionality with new PageHeader and SidebarContext
This commit is contained in:
15
src/App.tsx
15
src/App.tsx
@@ -1,6 +1,7 @@
|
||||
import { AppLayout } from '@/components/AppLayout'
|
||||
import { ProtectedRoute } from '@/components/ProtectedRoute'
|
||||
import { AuthProvider } from '@/contexts/AuthContext'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { ActivityPage } from '@/pages/ActivityPage'
|
||||
import { AdminUsersPage } from '@/pages/AdminUsersPage'
|
||||
import { DashboardPage } from '@/pages/DashboardPage'
|
||||
@@ -22,7 +23,7 @@ function App() {
|
||||
path="/dashboard"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout>
|
||||
<AppLayout title="Dashboard" description="Welcome to your dashboard">
|
||||
<DashboardPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
@@ -32,7 +33,7 @@ function App() {
|
||||
path="/activity"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout>
|
||||
<AppLayout title="Activity" description="View recent activity and logs">
|
||||
<ActivityPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
@@ -42,7 +43,7 @@ function App() {
|
||||
path="/settings"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<AppLayout>
|
||||
<AppLayout title="Settings" description="Manage your account settings and preferences">
|
||||
<SettingsPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
@@ -52,7 +53,13 @@ function App() {
|
||||
path="/admin/users"
|
||||
element={
|
||||
<ProtectedRoute requireAdmin>
|
||||
<AppLayout>
|
||||
<AppLayout
|
||||
title="User Management"
|
||||
description="Manage users and their permissions"
|
||||
headerActions={
|
||||
<Button>Add User</Button>
|
||||
}
|
||||
>
|
||||
<AdminUsersPage />
|
||||
</AppLayout>
|
||||
</ProtectedRoute>
|
||||
|
||||
Reference in New Issue
Block a user