This repository was archived by the owner on Aug 6, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { devMenuTemplate } from "./menu/dev_menu_template";
7
7
import { editMenuTemplate } from "./menu/edit_menu_template" ;
8
8
import createWindow from "./helpers/window" ;
9
9
import registerShortcuts from "./helpers/shortcuts" ;
10
+ import registerTouchBar from './helpers/touchbar' ;
10
11
11
12
// Special module holding environment variables which you declared
12
13
// in config/env_xxx.json file.
@@ -62,6 +63,7 @@ app.on("ready", () => {
62
63
) ;
63
64
64
65
registerShortcuts ( mainWindow , app ) ;
66
+ registerTouchBar ( mainWindow ) ;
65
67
66
68
if ( env . name === "development" ) {
67
69
mainWindow . openDevTools ( ) ;
Original file line number Diff line number Diff line change
1
+ import { TouchBar } from 'electron'
2
+
3
+ const { TouchBarButton } = TouchBar ;
4
+
5
+ export default ( window ) => {
6
+
7
+ const dashboardButton = new TouchBarButton ( {
8
+ label : '🏠 Dashboard' ,
9
+ click : ( ) => {
10
+ window . webContents . send ( 'change-path' , '/' )
11
+ }
12
+ } ) ;
13
+
14
+ const payButton = new TouchBarButton ( {
15
+ label : '👆 Pay' ,
16
+ click : ( ) => {
17
+ window . webContents . send ( 'change-path' , '/pay' )
18
+ }
19
+ } ) ;
20
+
21
+ const requestButton = new TouchBarButton ( {
22
+ label : '👇 Request' ,
23
+ click : ( ) => {
24
+ window . webContents . send ( 'change-path' , '/request' )
25
+ }
26
+ } ) ;
27
+
28
+ const bunqMeButton = new TouchBarButton ( {
29
+ label : '💰 bunq.me requests' ,
30
+ click : ( ) => {
31
+ window . webContents . send ( 'change-path' , '/bunqme-tab' )
32
+ }
33
+ } ) ;
34
+
35
+ const bar = new TouchBar ( [
36
+ dashboardButton ,
37
+ payButton ,
38
+ requestButton ,
39
+ bunqMeButton
40
+ ] ) ;
41
+
42
+ window . setTouchBar ( bar ) ;
43
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Grid from "material-ui/Grid";
5
5
import { withStyles } from "material-ui/styles" ;
6
6
import MuiThemeProvider from "material-ui/styles/MuiThemeProvider" ;
7
7
import createMuiTheme from "material-ui/styles/createMuiTheme" ;
8
+ import { ipcRenderer } from 'electron'
8
9
9
10
// custom components
10
11
import Logger from "../Helpers/Logger" ;
@@ -60,6 +61,15 @@ class Layout extends React.Component {
60
61
this . state = {
61
62
initialBunqConnect : false
62
63
} ;
64
+
65
+
66
+ ipcRenderer . on ( 'change-path' , ( event , path ) => {
67
+ const currentPath = this . props . history . location . pathname ;
68
+
69
+ if ( currentPath !== path ) {
70
+ this . props . history . push ( path ) ;
71
+ }
72
+ } ) ;
63
73
}
64
74
65
75
componentDidMount ( ) {
You can’t perform that action at this time.
0 commit comments