Commit 04007b59 by Apple\Apple

馃悰 fix(sidebar): fix the sidebar user permission to display navigation

parent f2bca12d
...@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next'; ...@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import { import {
isAdmin, isAdmin,
isRoot,
showError showError
} from '../../helpers/index.js'; } from '../../helpers/index.js';
...@@ -218,15 +219,17 @@ const SiderBar = () => { ...@@ -218,15 +219,17 @@ const SiderBar = () => {
itemKey: 'user', itemKey: 'user',
to: '/user', to: '/user',
icon: <IconUser />, icon: <IconUser />,
className: isAdmin() ? '' : 'tableHiddle',
}, },
{ {
text: t('绯荤粺璁剧疆'), text: t('绯荤粺璁剧疆'),
itemKey: 'setting', itemKey: 'setting',
to: '/setting', to: '/setting',
icon: <IconSetting />, icon: <IconSetting />,
className: isRoot() ? '' : 'tableHiddle',
}, },
], ],
[isAdmin(), t], [isAdmin(), isRoot(), t],
); );
const chatMenuItems = useMemo( const chatMenuItems = useMemo(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment