Skip to content

Commit

Permalink
feat: Add report issue menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
ashchan committed Aug 16, 2019
1 parent 9f3ccfc commit a3e49ff
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
8 changes: 0 additions & 8 deletions packages/neuron-wallet/src/controllers/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,6 @@ export default class AppController {
new UpdateController().checkUpdates(menuItem)
}

public static openWebsite() {
AppController.openExternal(URL.Website)
}

public static openRepository() {
AppController.openExternal(URL.Repository)
}

public static showPreference() {
AppController.navTo(URL.Preference)
}
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-wallet/src/controllers/app/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export enum MenuCommand {
}

export enum URL {
Website = 'https://www.nervos.org/',
Repository = 'https://github.com/nervosnetwork/neuron',
Preference = '/settings/general',
CreateWallet = '/wizard/mnemonic/create',
ImportMnemonic = '/wizard/mnemonic/import',
Expand Down
3 changes: 2 additions & 1 deletion packages/neuron-wallet/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default {
},
help: {
label: 'Help',
sourceCode: 'Source Code',
'source-code': 'Source Code',
'report-issue': 'Report Issue',
settings: 'Settings',
},
develop: {
Expand Down
3 changes: 2 additions & 1 deletion packages/neuron-wallet/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default {
},
help: {
label: '帮助',
sourceCode: '源代码',
'source-code': '源代码',
'report-issue': '报告问题',
settings: '设置',
},
develop: {
Expand Down
15 changes: 12 additions & 3 deletions packages/neuron-wallet/src/utils/application-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import env from 'env'
import i18n from 'utils/i18n'
import AppController from 'controllers/app'
import WalletsService from 'services/wallets'
import { ExternalURL } from 'utils/const'

const isMac = process.platform === 'darwin'

Expand Down Expand Up @@ -189,15 +190,23 @@ const generateTemplate = () => {
label: 'Nervos',
click: () => {
if (AppController) {
AppController.openWebsite()
AppController.openExternal(ExternalURL.Website)
}
},
},
{
label: i18n.t('application-menu.help.sourceCode'),
label: i18n.t('application-menu.help.source-code'),
click: () => {
if (AppController) {
AppController.openRepository()
AppController.openExternal(ExternalURL.Repository)
}
},
},
{
label: i18n.t('application-menu.help.report-issue'),
click: () => {
if (AppController) {
AppController.openExternal(ExternalURL.Issues)
}
},
},
Expand Down
6 changes: 6 additions & 0 deletions packages/neuron-wallet/src/utils/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export enum ResponseCode {
Success,
}

export enum ExternalURL {
Website = 'https://www.nervos.org/',
Repository = 'https://github.com/nervosnetwork/neuron',
Issues = 'https://github.com/nervosnetwork/neuron/issues',
}

export default {
Channel,
ResponseCode,
Expand Down

0 comments on commit a3e49ff

Please sign in to comment.