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

Commit 0934f9b

Browse files
authored
Merge pull request #3929 from brave/feature/payments-menu-item
Add Payments to Bravery system menu
2 parents 8bf0b0c + 3c760e3 commit 0934f9b

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

app/browser/menu.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ const createMenu = () => {
527527
label: locale.translation('bravery'),
528528
submenu: [
529529
CommonMenu.braveryGlobalMenuItem(),
530-
CommonMenu.braverySiteMenuItem()
530+
CommonMenu.braverySiteMenuItem(),
531+
CommonMenu.braveryPaymentsMenuItem()
531532
]
532533
},
533534
{ label: locale.translation('window'), submenu: createWindowSubmenu(), role: 'window' },

app/common/commonMenu.js

+19
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,22 @@ module.exports.braveryGlobalMenuItem = () => {
349349
}
350350
}
351351
}
352+
353+
module.exports.braveryPaymentsMenuItem = () => {
354+
const label =
355+
getSetting(settings.PAYMENTS_ENABLED)
356+
? locale.translation('braveryPayments')
357+
: locale.translation('braveryStartUsingPayments')
358+
return {
359+
label: label,
360+
click: (item, focusedWindow) => {
361+
if (BrowserWindow.getAllWindows().length === 0) {
362+
appActions.newWindow(Immutable.fromJS({
363+
location: 'about:preferences#payments'
364+
}))
365+
} else {
366+
module.exports.sendToFocusedWindow(focusedWindow, [messages.SHORTCUT_NEW_FRAME, 'about:preferences#payments', { singleFrame: true }])
367+
}
368+
}
369+
}
370+
}

app/extensions/brave/locales/en-US/menu.properties

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ bookmarksToolbar=Bookmarks Toolbar
8484
bravery=Bravery
8585
braverySite=Bravery site settings...
8686
braveryGlobal=Bravery global settings...
87+
braveryPayments=Brave payments...
88+
braveryStartUsingPayments=Start using Brave payments...
8789
addBookmark=Add Bookmark...
8890
addFolder=Add Folder...
8991
unmuteTabs=Unmute Tabs

app/locale.js

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ var rendererIdentifiers = function () {
148148
'bravery',
149149
'braverySite',
150150
'braveryGlobal',
151+
'braveryPayments',
152+
'braveryStartUsingPayments',
151153
'blockPopups',
152154
'learnSpelling',
153155
'ignoreSpelling',

js/contextMenus.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ function hamburgerTemplateInit (location, e) {
629629
label: locale.translation('bravery'),
630630
submenu: [
631631
CommonMenu.braveryGlobalMenuItem(),
632-
CommonMenu.braverySiteMenuItem()
632+
CommonMenu.braverySiteMenuItem(),
633+
CommonMenu.braveryPaymentsMenuItem()
633634
]
634635
},
635636
CommonMenu.downloadsMenuItem(),

0 commit comments

Comments
 (0)