mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
fix appmenu keys again
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import isElectron from 'is-electron';
|
import isElectron from 'is-electron';
|
||||||
import { ReactNode } from 'react';
|
import { Fragment, ReactNode } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useNavigate } from 'react-router';
|
import { Link, useNavigate } from 'react-router';
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ export const AppMenu = () => {
|
|||||||
const menuConfig: MenuItem[] = [
|
const menuConfig: MenuItem[] = [
|
||||||
{
|
{
|
||||||
condition: privateMode,
|
condition: privateMode,
|
||||||
id: 'private-mode',
|
id: 'private-mode-off',
|
||||||
item: {
|
item: {
|
||||||
icon: 'lock',
|
icon: 'lock',
|
||||||
iconColor: 'error',
|
iconColor: 'error',
|
||||||
@@ -119,7 +119,7 @@ export const AppMenu = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
condition: !privateMode,
|
condition: !privateMode,
|
||||||
id: 'private-mode',
|
id: 'private-mode-on',
|
||||||
item: {
|
item: {
|
||||||
icon: 'lockOpen',
|
icon: 'lockOpen',
|
||||||
label: t('page.appMenu.privateModeOn', { postProcess: 'sentenceCase' }),
|
label: t('page.appMenu.privateModeOn', { postProcess: 'sentenceCase' }),
|
||||||
@@ -155,7 +155,7 @@ export const AppMenu = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
condition: collapsed,
|
condition: collapsed,
|
||||||
id: 'sidebar-toggle',
|
id: 'sidebar-expand',
|
||||||
item: {
|
item: {
|
||||||
icon: 'panelRightOpen',
|
icon: 'panelRightOpen',
|
||||||
id: 'expand-sidebar',
|
id: 'expand-sidebar',
|
||||||
@@ -167,7 +167,7 @@ export const AppMenu = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
condition: !collapsed,
|
condition: !collapsed,
|
||||||
id: 'sidebar-toggle',
|
id: 'sidebar-collapse',
|
||||||
item: {
|
item: {
|
||||||
icon: 'panelRightClose',
|
icon: 'panelRightClose',
|
||||||
id: 'collapse-sidebar',
|
id: 'collapse-sidebar',
|
||||||
@@ -246,12 +246,17 @@ export const AppMenu = () => {
|
|||||||
case 'conditional-group':
|
case 'conditional-group':
|
||||||
if (!item.condition) return null;
|
if (!item.condition) return null;
|
||||||
return (
|
return (
|
||||||
<div key={item.id}>{item.items.map((subItem) => renderMenuItem(subItem))}</div>
|
<div key={item.id}>
|
||||||
|
{item.items.map((subItem) => {
|
||||||
|
console.log(subItem.id);
|
||||||
|
return <Fragment key={subItem.id}>{renderMenuItem(subItem)}</Fragment>;
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'conditional-item':
|
case 'conditional-item':
|
||||||
if (!item.condition) return null;
|
if (!item.condition) return null;
|
||||||
return renderMenuItem(item.item as MenuItem);
|
return <Fragment key={item.id}>{renderMenuItem(item.item as MenuItem)}</Fragment>;
|
||||||
|
|
||||||
case 'custom':
|
case 'custom':
|
||||||
return <div key={item.id}>{item.component}</div>;
|
return <div key={item.id}>{item.component}</div>;
|
||||||
|
|||||||
Reference in New Issue
Block a user