feat: 统一管理端导航为后端下发菜单,移除本地权限过滤
This commit is contained in:
@@ -30,9 +30,9 @@ export function WalletSubnav(): React.ReactElement {
|
||||
aria-label={t("subnavLabel")}
|
||||
className="mb-6 flex flex-wrap gap-2 border-b border-border pb-3"
|
||||
>
|
||||
{tabs.map((t) => {
|
||||
const allowed = adminHasAnyPermission(perms, [...t.requiredAny]);
|
||||
const active = pathname === t.href || pathname.startsWith(`${t.href}/`);
|
||||
{tabs.map((tab) => {
|
||||
const allowed = adminHasAnyPermission(perms, [...tab.requiredAny]);
|
||||
const active = pathname === tab.href || pathname.startsWith(`${tab.href}/`);
|
||||
const className = cn(
|
||||
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
|
||||
active
|
||||
@@ -42,14 +42,14 @@ export function WalletSubnav(): React.ReactElement {
|
||||
);
|
||||
if (!allowed) {
|
||||
return (
|
||||
<span key={t.href} className={className} title={t("noPermission")}>
|
||||
{t(t.label)}
|
||||
<span key={tab.href} className={className} title={t("noPermission")}>
|
||||
{t(tab.label)}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Link key={t.href} href={t.href} className={className}>
|
||||
{t(t.label)}
|
||||
<Link key={tab.href} href={tab.href} className={className}>
|
||||
{t(tab.label)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user