From 37d84a724c9bf76256684f7068318fe60b9da5dd Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 4 Nov 2015 08:58:12 +0000 Subject: [PATCH] Added close button functionality --- src/js/components/navbar.js | 9 +++++++-- src/main.js | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/components/navbar.js b/src/js/components/navbar.js index 8dcbb67..bd4eccc 100644 --- a/src/js/components/navbar.js +++ b/src/js/components/navbar.js @@ -1,14 +1,19 @@ var React = require('react'); +var ipc = window.require('ipc'); var NavBar = React.createClass({ + handleClose: function (evt) { + ipc.send('close'); + }, + render: function () { return ( diff --git a/src/main.js b/src/main.js index c625def..b4ebc16 100644 --- a/src/main.js +++ b/src/main.js @@ -40,4 +40,8 @@ ipc.on('hide', function () { ipc.on('show', function () { mainWindow.show(); +}); + +ipc.on('close', function () { + mainWindow.close(); }); \ No newline at end of file