diff --git a/plugins/lime-plugin-firmware/src/upgradeAvailable.js b/plugins/lime-plugin-firmware/src/upgradeAvailable.js index bc3cadfb7..82a865ba8 100644 --- a/plugins/lime-plugin-firmware/src/upgradeAvailable.js +++ b/plugins/lime-plugin-firmware/src/upgradeAvailable.js @@ -22,7 +22,7 @@ export const UpgradeAvailableBanner = () => { // @ts-ignore {({ path }) => - !["firmware", "releaseInfo", "meshwideupgrade"].includes( + !["firmware", "releaseInfo", "meshwide/upgrade"].includes( path.replace("/", "") ) && (
( + + + + Mesh Wide Config + + +); diff --git a/plugins/lime-plugin-mesh-wide-upgrade/index.ts b/plugins/lime-plugin-mesh-wide-upgrade/index.ts index 18c78799f..4a3b6e6fb 100644 --- a/plugins/lime-plugin-mesh-wide-upgrade/index.ts +++ b/plugins/lime-plugin-mesh-wide-upgrade/index.ts @@ -2,8 +2,9 @@ import { MeshUpgradeMenu } from "plugins/lime-plugin-mesh-wide-upgrade/src/meshU import MeshUpgradePage from "plugins/lime-plugin-mesh-wide-upgrade/src/meshUpgradePage"; export default { - name: "MeshWideUpgrade", + name: "meshwide/upgrade", page: MeshUpgradePage, menu: MeshUpgradeMenu, isCommunityProtected: true, + menuGroup: "meshwide", } as LimePlugin; diff --git a/plugins/lime-plugin-mesh-wide-upgrade/src/meshUpgradeMenu.tsx b/plugins/lime-plugin-mesh-wide-upgrade/src/meshUpgradeMenu.tsx index cb5d73711..3b27bdc67 100755 --- a/plugins/lime-plugin-mesh-wide-upgrade/src/meshUpgradeMenu.tsx +++ b/plugins/lime-plugin-mesh-wide-upgrade/src/meshUpgradeMenu.tsx @@ -5,7 +5,7 @@ import { GlobeAmericasIcon } from "components/icons/teenny/globe"; export const MeshUpgradeMenu = () => ( - + Mesh Wide Upgrade diff --git a/plugins/lime-plugin-mesh-wide/index.ts b/plugins/lime-plugin-mesh-wide/index.ts index 1837c2c72..0fe963120 100644 --- a/plugins/lime-plugin-mesh-wide/index.ts +++ b/plugins/lime-plugin-mesh-wide/index.ts @@ -5,4 +5,5 @@ export default { name: "MeshWide", page: MeshWidePage, menu: MeshWideMenu, + menuGroup: "meshwide", } as LimePlugin; diff --git a/src/components/icons/teenny/adjust.jsx b/src/components/icons/teenny/adjust.jsx new file mode 100644 index 000000000..1584768ed --- /dev/null +++ b/src/components/icons/teenny/adjust.jsx @@ -0,0 +1,14 @@ +export const AdjustVertical = () => ( + + + +); diff --git a/src/config.ts b/src/config.ts index fd1219a79..9e0e6f8b2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -29,6 +29,6 @@ export const plugins: LimePlugin[] = [ ChangeNode, RemoteSupport, Pirania, + MeshConfigPage, Fbw, // does not have menu item - MeshConfigPage, // does not have menu item ]; diff --git a/src/containers/Menu/menu.js b/src/containers/Menu/menu.js index ce6e7a4d1..32e62c22e 100644 --- a/src/containers/Menu/menu.js +++ b/src/containers/Menu/menu.js @@ -1,18 +1,18 @@ -import { Trans } from "@lingui/macro"; -import { useState } from "preact/hooks"; - import { plugins } from "../../config"; import style from "./style.less"; export const Menu = ({ opened, toggle }) => { - const [currentView, setCurrentView] = useState("node"); - const hasCommunityPlugins = () => - plugins.filter((p) => p.menuView && p.menuView === "community").length > - 0; - function changeCurrentView(e) { - e.preventDefault(); - setCurrentView(currentView === "node" ? "community" : "node"); - } + // Group plugins by menuGroup + const groupedPlugins = plugins + .filter((plugin) => plugin.page && plugin.menu) // Only include plugins with both `page` and `menu` + .reduce((groups, plugin) => { + const group = plugin.menuGroup || "default"; // Use "default" for plugins without a menuGroup + if (!groups[group]) { + groups[group] = []; + } + groups[group].push(plugin.menu); + return groups; + }, {}); return (
{ } d-flex flex-column`} > - {hasCommunityPlugins() && ( - - )} + {components.map((Component, index) => ( + + ))} +
+ ))} +
); }; diff --git a/src/types.d.ts b/src/types.d.ts index 349bdbbf3..71fabd784 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -12,15 +12,8 @@ interface LimePlugin { name: string; page: typeof JSX.Element; menu: typeof JSX.Element; - menuView?: string; isCommunityProtected?: boolean; additionalRoutes?: LimeRoutes[]; additionalProtectedRoutes?: LimeRoutes[]; - store?: { - name: string; - epics?: any; // FIXME - reducer?: any; // FIXME - selector?: any; // FIXME - constants?: any; // FIXME - }; + menuGroup?: string; }