Skip to content

Commit 0617d45

Browse files
Merge pull request #183 from ekonstantinidis/update-electron
Hello Electron 1.0.2
2 parents 810e316 + 3871bad commit 0617d45

File tree

7 files changed

+54
-32
lines changed

7 files changed

+54
-32
lines changed

main.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
const path = require('path');
2+
13
const electron = require('electron');
4+
const BrowserWindow = electron.BrowserWindow;
5+
const Menu = electron.Menu;
6+
const Tray = electron.Tray;
27
const app = electron.app;
8+
const dialog = electron.dialog;
39
const ipc = electron.ipcMain;
410

5-
var path = require('path');
611
var ghReleases = require('electron-gh-releases');
712
var Positioner = require('electron-positioner');
813

9-
var Menu = require('menu');
10-
var Tray = require('tray');
1114
var AutoLaunch = require('auto-launch');
12-
var BrowserWindow = require('browser-window');
13-
var dialog = require('dialog');
1415

1516
var iconIdle = path.join(__dirname, 'images', 'tray-idleTemplate.png');
1617
var iconActive = path.join(__dirname, 'images', 'tray-active.png');

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"mocha": "mocha --opts src/js/__tests__/__helpers__/mocha.opts",
1616
"coverage": "babel-node ./node_modules/istanbul/lib/cli cover node_modules/mocha/bin/_mocha -- --opts src/js/__tests__/__helpers__/mocha.opts",
1717
"test": "npm run lint-js && npm run lint-sass && npm run coverage",
18-
"start": "electron . --enable-logging"
18+
"start": "electron . enable-logging"
1919
},
2020
"repository": {
2121
"type": "git",
@@ -51,14 +51,13 @@
5151
"dependencies": {
5252
"auto-launch": "=2.0.1",
5353
"bootstrap": "=4.0.0-alpha.2",
54-
"electron-gh-releases": "=2.0.2",
55-
"electron-positioner": "=2.0.3",
5654
"font-awesome": "=4.6.1",
5755
"history": "=2.1.1",
5856
"malarkey": "=1.3.3",
5957
"octicons": "=3.5.0",
6058
"react": "=15.0.2",
6159
"react-addons-css-transition-group": "=15.0.2",
60+
"react-addons-pure-render-mixin": "=15.0.2",
6261
"react-addons-test-utils": "=15.0.2",
6362
"react-dom": "=15.0.2",
6463
"react-emojione": "=1.1.1",
@@ -84,14 +83,16 @@
8483
"babel-preset-stage-0": "=6.5.0",
8584
"chai": "=3.5.0",
8685
"css-loader": "=0.23.1",
86+
"electron-gh-releases": "=2.0.2",
8787
"electron-packager": "=7.0.1",
88-
"electron-prebuilt": "=0.37.8",
89-
"enzyme": "=2.2.0",
88+
"electron-prebuilt": "=1.0.2",
89+
"electron-positioner": "=3.0.0",
90+
"enzyme": "=2.3.0",
9091
"eslint": "=2.9.0",
91-
"eslint-plugin-react": "=5.0.1",
92+
"eslint-plugin-react": "=5.1.1",
9293
"file-loader": "=0.8.5",
9394
"istanbul": "=1.0.0-alpha.2",
94-
"jsdom": "=8.5.0",
95+
"jsdom": "=9.0.0",
9596
"json-loader": "=0.5.4",
9697
"mocha": "=2.4.5",
9798
"nock": "=8.0.0",

src/js/__tests__/components/search.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ describe('components/search.js', function () {
4646
const { wrapper } = setup(props);
4747

4848
expect(wrapper).to.exist;
49-
50-
expect(wrapper.find('.container-fluid').length).to.equal(1);
49+
expect(wrapper.find('.container-fluid').length).to.equal(0);
5150
expect(wrapper.find('.search-bar').length).to.equal(0);
5251

5352
});

src/js/components/all-read.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import React from 'react';
21
import _ from 'underscore';
2+
import React from 'react';
3+
import PureRenderMixin from 'react-addons-pure-render-mixin';
34
import malarkey from 'malarkey';
45
import {emojify} from 'react-emojione';
56

67
import constants from '../utils/constants';
78

89
export default class AllRead extends React.Component {
10+
constructor(props) {
11+
super(props);
12+
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
13+
}
914

1015
componentDidMount() {
1116
const message = _.sample(constants.ALLREAD_MESSAGES);

src/js/components/oops.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
import React from 'react';
21
import _ from 'underscore';
2+
import React from 'react';
3+
import PureRenderMixin from 'react-addons-pure-render-mixin';
34
import {emojify} from 'react-emojione';
45

56
import constants from '../utils/constants';
67

78
export default class Oops extends React.Component {
9+
constructor(props) {
10+
super(props);
11+
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
12+
}
13+
814
render() {
915
const emoji = _.sample(constants.ERROR_EMOJIS);
1016

src/js/components/search.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export class SearchBar extends React.Component {
1212
}
1313

1414
render() {
15+
if (!this.props.showSearch) {
16+
return null;
17+
}
18+
1519
var clearSearchIcon;
1620

1721
if (this.props.query) {
@@ -21,22 +25,21 @@ export class SearchBar extends React.Component {
2125
}
2226

2327
return (
24-
<div className={this.props.showSearch ? 'container-fluid search-bar' : 'container-fluid' }>
25-
{this.props.showSearch ? (
26-
<div className="row">
27-
<div className="col-xs-10">
28-
<div className="form-group search-wrapper">
29-
<input
30-
autoFocus
31-
value={this.props.query}
32-
onChange={(evt) => this.props.searchNotifications(evt.target.value)}
33-
className="form-control"
34-
type="text"
35-
placeholder=" Search..." />
36-
</div>
28+
<div className="container-fluid search-bar">
29+
<div className="row">
30+
<div className="col-xs-10">
31+
<div className="form-group search-wrapper">
32+
<input
33+
autoFocus
34+
value={this.props.query}
35+
onChange={(evt) => this.props.searchNotifications(evt.target.value)}
36+
className="form-control"
37+
type="text"
38+
placeholder=" Search..." />
39+
</div>
3740
</div>
3841
<div className="col-xs-2">{clearSearchIcon}</div>
39-
</div>) : null }
42+
</div>
4043
</div>
4144
);
4245
}

src/scss/app.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ input {
292292
color: $white;
293293

294294
.row {
295-
margin: 12px 10px;
295+
margin: 10px 5px;
296+
font-size: .95rem;
297+
font-weight: 300;
296298

297299
.col-xs-4 {
298300
text-align: right;
@@ -356,6 +358,10 @@ input {
356358
padding: 0;
357359
}
358360

361+
.col-xs-1 {
362+
padding: 5px 0;
363+
}
364+
359365
.avatar {
360366
@include border-radius(50%);
361367
margin-top: 5px;
@@ -380,10 +386,11 @@ input {
380386
}
381387

382388
.check-wrapper {
383-
padding: 4px 5px;
389+
text-align: right;
384390

385391
.octicon {
386392
@include check-octicon;
393+
margin-right: 10px;
387394
font-size: 22px;
388395
}
389396
}

0 commit comments

Comments
 (0)