-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cbca17
commit 495a5e3
Showing
6 changed files
with
114 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import { MENU_STATE } from './menu-state.constant' | ||
import { menuState } from './menu' | ||
import { shell } from 'electron' | ||
import { DISCORD_URL, DOCUMENTATION_URL, ISSUE_REPORT_URL } from '@contexts/settings/constants' | ||
|
||
const menuItem = ( | ||
action: 'faq' | 'documentation' | 'discord' | 'reportAnIssue', | ||
url: string | ||
): Electron.MenuItemConstructorOptions => ({ | ||
label: MENU_STATE.strings[action], | ||
label: menuState.strings[action], | ||
click: () => void shell.openExternal(url), | ||
}) | ||
|
||
export const helpMenu: Electron.MenuItemConstructorOptions = { | ||
label: MENU_STATE.strings.help, | ||
submenu: [ | ||
// menuItem('faq', FAQ_URL), | ||
menuItem('documentation', DOCUMENTATION_URL), | ||
menuItem('discord', DISCORD_URL), | ||
menuItem('reportAnIssue', ISSUE_REPORT_URL), | ||
], | ||
export function buildHelpMenu(): Electron.MenuItemConstructorOptions { | ||
return { | ||
label: menuState.strings.help, | ||
submenu: [ | ||
// menuItem('faq', FAQ_URL), | ||
menuItem('documentation', DOCUMENTATION_URL), | ||
menuItem('discord', DISCORD_URL), | ||
menuItem('reportAnIssue', ISSUE_REPORT_URL), | ||
], | ||
} | ||
} |
59 changes: 31 additions & 28 deletions
59
packages/desktop/lib/electron/menus/menu-state.constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
import $ from '../../../../shared/src/locales/en.json' | ||
|
||
export const MENU_STATE = { | ||
enabled: true, | ||
strings: { | ||
about: 'About Bloom', | ||
checkForUpdates: 'Check for Updates', | ||
importThirdPartyProfiles: 'Import Third-Party Profiles', | ||
settings: 'Settings', | ||
security: 'Security', | ||
advanced: 'Advanced', | ||
errorLog: 'Error Log', | ||
diagnostics: 'Diagnostics', | ||
logout: 'Log Out', | ||
hide: 'Hide', | ||
hideOthers: 'Hide Others', | ||
showAll: 'Show All', | ||
quit: 'Quit', | ||
edit: 'Edit', | ||
undo: 'Undo', | ||
redo: 'Redo', | ||
cut: 'Cut', | ||
copy: 'Copy', | ||
paste: 'Paste', | ||
selectAll: 'Select All', | ||
wallet: 'Wallet', | ||
addAccount: 'Add Account', | ||
help: 'Help', | ||
faq: 'FAQ', | ||
documentation: 'Documentation', | ||
discord: 'Discord', | ||
reportAnIssue: 'Report an Issue', | ||
version: 'Version {version}', | ||
about: $.views.settings.about.title, | ||
addAccount: $.actions.addAccount, | ||
advanced: $.views.settings.advanced.title, | ||
checkForUpdates: $.actions.checkForUpdates, | ||
copy: $.actions.copy, | ||
cut: $.actions.cut, | ||
developerTools: $.general.developerTools, | ||
diagnostics: $.views.settings.diagnostics.title, | ||
discord: $.views.settings.discord.title, | ||
documentation: $.views.settings.documentation.title, | ||
edit: $.actions.edit, | ||
errorLog: $.views.settings.errorLog.title, | ||
faq: $.views.settings.faq.title, | ||
help: $.general.help, | ||
hide: $.actions.hide, | ||
hideOthers: $.actions.hideOthers, | ||
importThirdPartyProfiles: $.actions.importThirdPartyProfiles, | ||
logout: $.views.dashboard.profileMenu.logout, | ||
paste: $.actions.paste, | ||
quit: $.actions.quit, | ||
redo: $.actions.redo, | ||
reportAnIssue: $.actions.reportAnIssue, | ||
security: $.views.settings.security.title, | ||
selectAll: $.actions.selectAll, | ||
settings: $.views.settings.settings, | ||
showAll: $.actions.showAll, | ||
undo: $.actions.undo, | ||
version: $.general.versionFull, | ||
wallet: $.general.wallet, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { getOrInitWindow } from '../processes/main.process' | ||
import { MENU_STATE } from './menu-state.constant' | ||
import { menuState } from './menu' | ||
|
||
export const walletMenu: Electron.MenuItemConstructorOptions = { | ||
label: MENU_STATE.strings.wallet, | ||
submenu: [ | ||
{ type: 'separator' }, | ||
{ | ||
label: MENU_STATE.strings.logout, | ||
click: (): void => getOrInitWindow('main').webContents.send('menu-logout'), | ||
enabled: MENU_STATE.enabled, | ||
}, | ||
], | ||
export function buildWalletMenu(): Electron.MenuItemConstructorOptions { | ||
return { | ||
label: menuState.strings.wallet, | ||
submenu: [ | ||
{ type: 'separator' }, | ||
{ | ||
label: menuState.strings.logout, | ||
click: (): void => getOrInitWindow('main').webContents.send('menu-logout'), | ||
enabled: menuState.enabled, | ||
}, | ||
], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters