import { app, shell } from 'electron';

let template = [
    {
        label: 'Edit',
        submenu: [
            { label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
            { label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
            { type: "separator" },
            { label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
            { label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
            { label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
            { label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
        ]
    },
    {
        role: 'window',
        submenu: [
            { label: 'Close', accelerator: 'CmdOrCtrl+W', role: 'close' },
            { label: 'Minimize', accelerator: 'CmdOrCtrl+M', role: 'minimize' },
            { type: 'separator' },
            { label: 'Bring All to Front', role: 'front' }
        ]
    },
    {
        role: 'help',
        submenu: [
            { label: 'Learn More', click() { shell.openExternal('http://ubauth.enytc.com'); } },
        ]
    },
];

if (process.platform === 'darwin') {
    let name = app.getName();

    template.unshift({
        label: name,
        submenu: [
            {
                role: 'about'
            },
            {
                type: 'separator'
            },
            {
                role: 'services',
                submenu: []
            },
            {
                type: 'separator'
            },
            {
                role: 'hide'
            },
            {
                role: 'hideothers'
            },
            {
                role: 'unhide'
            },
            {
                type: 'separator'
            },
            {
                role: 'quit'
            },
        ]
    });
}

export default template;

@@ -989,32 +989,367 @@
      submenu: %5B%0A
+            %7B label: 'Donate', click() %7B shell.openExternal('https://github.com/chrisenytc/ubauth#donate'); %7D %7D,%0A            %7B label: 'Author', click() %7B shell.openExternal('https://github.com/chrisenytc'); %7D %7D,%0A            %7B label: 'Contribute', click() %7B shell.openExternal('https://github.com/chrisenytc/ubauth#contributing'); %7D %7D,%0A
             %7B la
@@ -1423,25 +1423,24 @@
 c.com'); %7D %7D
-,
 %0A        %5D%0A 

Update app menu template