fix
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
UserOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import { Avatar, Button, Layout, Menu, Result, Space, Tag, Typography } from 'antd'
|
||||
import { Outlet, useLocation } from 'react-router-dom'
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
|
||||
import { ROLE_MANAGE_AREA, ROLE_MANAGE_ATTRACTION } from '@/auth/roles'
|
||||
import { useAuth } from '@/auth/AuthContext'
|
||||
|
||||
@@ -21,6 +21,7 @@ const ROLE_LABELS: Record<string, string> = {
|
||||
export function AdminLayout() {
|
||||
const { email, roles, logout } = useAuth()
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const hasManageArea = roles.includes(ROLE_MANAGE_AREA)
|
||||
const hasManageAttraction = roles.includes(ROLE_MANAGE_ATTRACTION)
|
||||
@@ -102,6 +103,7 @@ export function AdminLayout() {
|
||||
mode="inline"
|
||||
selectedKeys={[selectedKey]}
|
||||
items={menuItems}
|
||||
onClick={({ key }) => navigate(key)}
|
||||
style={{ height: '100%', borderRight: 0, paddingTop: 8 }}
|
||||
/>
|
||||
</Sider>
|
||||
|
||||
Reference in New Issue
Block a user