Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3929 from brave/feature/payments-menu-item
Browse files Browse the repository at this point in the history
Add Payments to Bravery system menu
  • Loading branch information
diracdeltas authored Sep 12, 2016
2 parents 8bf0b0c + 3c760e3 commit 0934f9b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/browser/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ const createMenu = () => {
label: locale.translation('bravery'),
submenu: [
CommonMenu.braveryGlobalMenuItem(),
CommonMenu.braverySiteMenuItem()
CommonMenu.braverySiteMenuItem(),
CommonMenu.braveryPaymentsMenuItem()
]
},
{ label: locale.translation('window'), submenu: createWindowSubmenu(), role: 'window' },
Expand Down
19 changes: 19 additions & 0 deletions app/common/commonMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,22 @@ module.exports.braveryGlobalMenuItem = () => {
}
}
}

module.exports.braveryPaymentsMenuItem = () => {
const label =
getSetting(settings.PAYMENTS_ENABLED)
? locale.translation('braveryPayments')
: locale.translation('braveryStartUsingPayments')
return {
label: label,
click: (item, focusedWindow) => {
if (BrowserWindow.getAllWindows().length === 0) {
appActions.newWindow(Immutable.fromJS({
location: 'about:preferences#payments'
}))
} else {
module.exports.sendToFocusedWindow(focusedWindow, [messages.SHORTCUT_NEW_FRAME, 'about:preferences#payments', { singleFrame: true }])
}
}
}
}
2 changes: 2 additions & 0 deletions app/extensions/brave/locales/en-US/menu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ bookmarksToolbar=Bookmarks Toolbar
bravery=Bravery
braverySite=Bravery site settings...
braveryGlobal=Bravery global settings...
braveryPayments=Brave payments...
braveryStartUsingPayments=Start using Brave payments...
addBookmark=Add Bookmark...
addFolder=Add Folder...
unmuteTabs=Unmute Tabs
Expand Down
2 changes: 2 additions & 0 deletions app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ var rendererIdentifiers = function () {
'bravery',
'braverySite',
'braveryGlobal',
'braveryPayments',
'braveryStartUsingPayments',
'blockPopups',
'learnSpelling',
'ignoreSpelling',
Expand Down
3 changes: 2 additions & 1 deletion js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ function hamburgerTemplateInit (location, e) {
label: locale.translation('bravery'),
submenu: [
CommonMenu.braveryGlobalMenuItem(),
CommonMenu.braverySiteMenuItem()
CommonMenu.braverySiteMenuItem(),
CommonMenu.braveryPaymentsMenuItem()
]
},
CommonMenu.downloadsMenuItem(),
Expand Down

0 comments on commit 0934f9b

Please sign in to comment.