diff --git a/src/main/menu.ts b/src/main/menu.ts index ba0fb77..ed5eb59 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -29,7 +29,7 @@ export default class MenuBuilder { const template = process.platform === 'darwin' ? this.buildDarwinTemplate() - : this.buildDefaultTemplate(); + : []; const menu = Menu.buildFromTemplate(template); Menu.setApplicationMenu(menu); @@ -54,17 +54,17 @@ export default class MenuBuilder { buildDarwinTemplate(): MenuItemConstructorOptions[] { const subMenuAbout: DarwinMenuItemConstructorOptions = { - label: 'Electron', + label: 'Nutrition Planner', submenu: [ { - label: 'About ElectronReact', + label: 'About Nutrition Planner', selector: 'orderFrontStandardAboutPanel:', }, { type: 'separator' }, { label: 'Services', submenu: [] }, { type: 'separator' }, { - label: 'Hide ElectronReact', + label: 'Hide Nutrition Planner', accelerator: 'Command+H', selector: 'hide:', }, @@ -151,37 +151,6 @@ export default class MenuBuilder { { label: 'Bring All to Front', selector: 'arrangeInFront:' }, ], }; - const subMenuHelp: MenuItemConstructorOptions = { - label: 'Help', - submenu: [ - { - label: 'Learn More', - click() { - shell.openExternal('https://electronjs.org'); - }, - }, - { - label: 'Documentation', - click() { - shell.openExternal( - 'https://github.com/electron/electron/tree/main/docs#readme', - ); - }, - }, - { - label: 'Community Discussions', - click() { - shell.openExternal('https://www.electronjs.org/community'); - }, - }, - { - label: 'Search Issues', - click() { - shell.openExternal('https://github.com/electron/electron/issues'); - }, - }, - ], - }; const subMenuView = process.env.NODE_ENV === 'development' || @@ -189,102 +158,6 @@ export default class MenuBuilder { ? subMenuViewDev : subMenuViewProd; - return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp]; - } - - buildDefaultTemplate() { - const templateDefault = [ - { - label: '&File', - submenu: [ - { - label: '&Open', - accelerator: 'Ctrl+O', - }, - { - label: '&Close', - accelerator: 'Ctrl+W', - click: () => { - this.mainWindow.close(); - }, - }, - ], - }, - { - label: '&View', - submenu: - process.env.NODE_ENV === 'development' || - process.env.DEBUG_PROD === 'true' - ? [ - { - label: '&Reload', - accelerator: 'Ctrl+R', - click: () => { - this.mainWindow.webContents.reload(); - }, - }, - { - label: 'Toggle &Full Screen', - accelerator: 'F11', - click: () => { - this.mainWindow.setFullScreen( - !this.mainWindow.isFullScreen(), - ); - }, - }, - { - label: 'Toggle &Developer Tools', - accelerator: 'Alt+Ctrl+I', - click: () => { - this.mainWindow.webContents.toggleDevTools(); - }, - }, - ] - : [ - { - label: 'Toggle &Full Screen', - accelerator: 'F11', - click: () => { - this.mainWindow.setFullScreen( - !this.mainWindow.isFullScreen(), - ); - }, - }, - ], - }, - { - label: 'Help', - submenu: [ - { - label: 'Learn More', - click() { - shell.openExternal('https://electronjs.org'); - }, - }, - { - label: 'Documentation', - click() { - shell.openExternal( - 'https://github.com/electron/electron/tree/main/docs#readme', - ); - }, - }, - { - label: 'Community Discussions', - click() { - shell.openExternal('https://www.electronjs.org/community'); - }, - }, - { - label: 'Search Issues', - click() { - shell.openExternal('https://github.com/electron/electron/issues'); - }, - }, - ], - }, - ]; - - return templateDefault; + return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow]; } } diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index e078078..d2131b7 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -3,7 +3,6 @@ import GroupsPage from './pages/groups'; import ItemsPage from './pages/items'; import PlansPage from './pages/plans'; import LogPage from './pages'; - import { Provider as RxDbProvider } from 'rxdb-hooks'; import { useState, useEffect } from 'react'; import { addRxPlugin } from 'rxdb'; @@ -19,6 +18,7 @@ import { VStack, extendTheme, type ThemeConfig, + ColorModeScript, } from '@chakra-ui/react'; import '../../styles/style.scss'; import '../../styles/react-big-calendar.scss'; @@ -68,6 +68,7 @@ export default function App() { return ( +