Browse Source

Merge pull request #20 from loeck/next

Create UpdateNotifier and connect it to updates statuses
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
60860de612
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package.json
  2. 43
      src/components/Wrapper.js
  3. 21
      src/main/app.js
  4. 1
      src/styles/global.js
  5. 67
      yarn.lock

2
package.json

@ -62,7 +62,7 @@
"babel-preset-stage-0": "^6.24.1", "babel-preset-stage-0": "^6.24.1",
"concurrently": "^3.5.1", "concurrently": "^3.5.1",
"electron": "1.7.10", "electron": "1.7.10",
"electron-builder": "^19.53.6", "electron-builder": "^19.53.7",
"electron-webpack": "1.11.0", "electron-webpack": "1.11.0",
"eslint": "^4.13.1", "eslint": "^4.13.1",
"eslint-config-airbnb": "^16.1.0", "eslint-config-airbnb": "^16.1.0",

43
src/components/Wrapper.js

@ -1,6 +1,7 @@
// @flow // @flow
import React from 'react' import React, { PureComponent } from 'react'
import { ipcRenderer } from 'electron' // eslint-disable-line import/no-extraneous-dependencies
import { Route } from 'react-router' import { Route } from 'react-router'
import { translate } from 'react-i18next' import { translate } from 'react-i18next'
@ -16,21 +17,29 @@ import UpdateNotifier from 'components/UpdateNotifier'
import SideBar from 'components/SideBar' import SideBar from 'components/SideBar'
import TopBar from 'components/TopBar' import TopBar from 'components/TopBar'
const Wrapper = () => ( class Wrapper extends PureComponent<{}> {
<Box grow horizontal> componentDidMount() {
<SideBar /> ipcRenderer.send('renderer-ready')
<Box shrink grow bg="cream"> }
<TopBar />
<Route path="/" component={DashboardPage} /> render() {
<Route path="/settings" component={SettingsPage} /> return (
<Route path="/account/:account" component={AccountPage} /> <Box grow horizontal>
</Box> <SideBar />
<Box shrink grow bg="cream">
<SendModal /> <TopBar />
<ReceiveModal /> <Route path="/" component={DashboardPage} />
<Route path="/settings" component={SettingsPage} />
<UpdateNotifier /> <Route path="/account/:account" component={AccountPage} />
</Box> </Box>
)
<SendModal />
<ReceiveModal />
<UpdateNotifier />
</Box>
)
}
}
export default translate()(Wrapper) export default translate()(Wrapper)

21
src/main/app.js

@ -1,14 +1,23 @@
// @flow // @flow
import { app, BrowserWindow } from 'electron' // eslint-disable-line import/no-extraneous-dependencies import { app, ipcMain, BrowserWindow } from 'electron' // eslint-disable-line import/no-extraneous-dependencies
// necessary to prevent win from being garbage collected // necessary to prevent win from being garbage collected
let mainWindow let mainWindow
function createMainWindow() { function createMainWindow() {
const window = new BrowserWindow({ const windowOptions = {
vibrancy: 'dark', ...(process.platform === 'darwin'
}) ? {
frame: false,
titleBarStyle: 'hiddenInset',
vibrancy: 'ultra-dark',
}
: {}),
show: false,
}
const window = new BrowserWindow(windowOptions)
const url = __DEV__ const url = __DEV__
? `http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT || ''}` ? `http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT || ''}`
@ -24,6 +33,10 @@ function createMainWindow() {
mainWindow = null mainWindow = null
}) })
ipcMain.on('renderer-ready', () => {
window.show()
})
window.webContents.on('devtools-opened', () => { window.webContents.on('devtools-opened', () => {
window.focus() window.focus()
setImmediate(() => { setImmediate(() => {

1
src/styles/global.js

@ -22,6 +22,7 @@ injectGlobal`
line-height: 1.5; line-height: 1.5;
font-size: 16px; font-size: 16px;
font-family: "Open Sans", Arial, Helvetica, sans-serif; font-family: "Open Sans", Arial, Helvetica, sans-serif;
-webkit-app-region: drag;
} }
#app { #app {

67
yarn.lock

@ -1589,7 +1589,16 @@ buffers@~0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb"
builder-util-runtime@4.0.1, builder-util-runtime@^4.0.0, builder-util-runtime@^4.0.1, builder-util-runtime@~4.0.0: builder-util-runtime@4.0.2, builder-util-runtime@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.0.2.tgz#673f1a0f2e275e6f80a16ce57225589a003c9a52"
dependencies:
bluebird-lst "^1.0.5"
debug "^3.1.0"
fs-extra-p "^4.5.0"
sax "^1.2.4"
builder-util-runtime@^4.0.1, builder-util-runtime@~4.0.0:
version "4.0.1" version "4.0.1"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.0.1.tgz#d8423190a21e8c7cec185d589cb0cb888cc8e731" resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.0.1.tgz#d8423190a21e8c7cec185d589cb0cb888cc8e731"
dependencies: dependencies:
@ -1598,7 +1607,27 @@ builder-util-runtime@4.0.1, builder-util-runtime@^4.0.0, builder-util-runtime@^4
fs-extra-p "^4.5.0" fs-extra-p "^4.5.0"
sax "^1.2.4" sax "^1.2.4"
builder-util@4.1.5, builder-util@^4.1.0, builder-util@^4.1.2: builder-util@4.1.6, builder-util@^4.1.6:
version "4.1.6"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-4.1.6.tgz#369313429c3feebb75bb60808382397195e18a30"
dependencies:
"7zip-bin" "^2.3.4"
bluebird-lst "^1.0.5"
builder-util-runtime "^4.0.2"
chalk "^2.3.0"
debug "^3.1.0"
fs-extra-p "^4.5.0"
ini "^1.3.5"
is-ci "^1.1.0"
js-yaml "^3.10.0"
lazy-val "^1.0.3"
semver "^5.4.1"
source-map-support "^0.5.0"
stat-mode "^0.2.2"
temp-file "^3.1.1"
tunnel-agent "^0.6.0"
builder-util@^4.1.0:
version "4.1.5" version "4.1.5"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-4.1.5.tgz#924a7ea13368d8d3f9626d22de14a18ef170ff21" resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-4.1.5.tgz#924a7ea13368d8d3f9626d22de14a18ef170ff21"
dependencies: dependencies:
@ -2575,22 +2604,22 @@ ejs@^2.5.7:
version "2.5.7" version "2.5.7"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a" resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a"
electron-builder-lib@19.53.6: electron-builder-lib@19.53.7:
version "19.53.6" version "19.53.7"
resolved "https://registry.yarnpkg.com/electron-builder-lib/-/electron-builder-lib-19.53.6.tgz#c931f0eb488e62fb3fe46d5b027c3413f3bc7159" resolved "https://registry.yarnpkg.com/electron-builder-lib/-/electron-builder-lib-19.53.7.tgz#6c994f4ef6c0d8042b88449ad5c6481104a9d0c6"
dependencies: dependencies:
"7zip-bin" "^2.3.4" "7zip-bin" "^2.3.4"
asar-integrity "0.2.4" asar-integrity "0.2.4"
async-exit-hook "^2.0.1" async-exit-hook "^2.0.1"
bluebird-lst "^1.0.5" bluebird-lst "^1.0.5"
builder-util "4.1.5" builder-util "4.1.6"
builder-util-runtime "4.0.1" builder-util-runtime "4.0.2"
chromium-pickle-js "^0.2.0" chromium-pickle-js "^0.2.0"
debug "^3.1.0" debug "^3.1.0"
dmg-builder "3.1.0" dmg-builder "3.1.0"
ejs "^2.5.7" ejs "^2.5.7"
electron-osx-sign "0.4.7" electron-osx-sign "0.4.7"
electron-publish "19.53.3" electron-publish "19.53.7"
fs-extra-p "^4.5.0" fs-extra-p "^4.5.0"
hosted-git-info "^2.5.0" hosted-git-info "^2.5.0"
is-ci "^1.1.0" is-ci "^1.1.0"
@ -2605,15 +2634,15 @@ electron-builder-lib@19.53.6:
semver "^5.4.1" semver "^5.4.1"
temp-file "^3.1.1" temp-file "^3.1.1"
electron-builder@^19.53.6: electron-builder@^19.53.7:
version "19.53.6" version "19.53.7"
resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-19.53.6.tgz#02854a7815084902b33f15d633839ddaf4e345cd" resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-19.53.7.tgz#dae5d8d68b6016446a59b279acc1769a3bc555bc"
dependencies: dependencies:
bluebird-lst "^1.0.5" bluebird-lst "^1.0.5"
builder-util "4.1.5" builder-util "4.1.6"
builder-util-runtime "4.0.1" builder-util-runtime "4.0.2"
chalk "^2.3.0" chalk "^2.3.0"
electron-builder-lib "19.53.6" electron-builder-lib "19.53.7"
electron-download-tf "4.3.4" electron-download-tf "4.3.4"
fs-extra-p "^4.5.0" fs-extra-p "^4.5.0"
is-ci "^1.1.0" is-ci "^1.1.0"
@ -2675,13 +2704,13 @@ electron-osx-sign@0.4.7:
minimist "^1.2.0" minimist "^1.2.0"
plist "^2.1.0" plist "^2.1.0"
electron-publish@19.53.3: electron-publish@19.53.7:
version "19.53.3" version "19.53.7"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-19.53.3.tgz#d6c076b24e3558402794c8ee58f9722605aa40d9" resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-19.53.7.tgz#b52fb70d91fc65825a444c7dd9678761a4720695"
dependencies: dependencies:
bluebird-lst "^1.0.5" bluebird-lst "^1.0.5"
builder-util "^4.1.2" builder-util "^4.1.6"
builder-util-runtime "^4.0.0" builder-util-runtime "^4.0.2"
chalk "^2.3.0" chalk "^2.3.0"
fs-extra-p "^4.5.0" fs-extra-p "^4.5.0"
mime "^2.2.0" mime "^2.2.0"

Loading…
Cancel
Save