File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const electron = require ( 'electron' )
2- import { connect } from 'react-redux'
3- const ipc = electron . ipcRenderer
41import React , { PropTypes } from 'react'
2+ import { connect } from 'react-redux'
53import SideNav from './SideNav'
64import ArticleTopBar from './ArticleTopBar'
75import ArticleList from './ArticleList'
86import ArticleDetail from './ArticleDetail'
97import Repository from 'browser/lib/Repository'
8+ import StatusBar from './StatusBar'
109
1110class Main extends React . Component {
12- constructor ( props ) {
13- super ( props )
14- this . state = { updateAvailable : false }
15- }
16-
1711 componentDidMount ( ) {
1812 let { dispatch } = this . props
19- ipc . on ( 'update-available' , function ( message ) {
20- this . setState ( { updateAvailable : true } )
21- } . bind ( this ) )
2213
2314 // Reload all data
2415 Repository . loadAll ( )
@@ -27,33 +18,24 @@ class Main extends React.Component {
2718 } )
2819 }
2920
30- updateApp ( ) {
31- ipc . send ( 'update-app' , 'Deal with it.' )
32- }
33-
3421 render ( ) {
3522 return (
3623 < div
3724 className = 'Main'
3825 >
39- { this . state . updateAvailable ? (
40- < button onClick = { this . updateApp } className = 'appUpdateButton' > < i className = 'fa fa-cloud-download' /> Update available!</ button >
41- ) : null }
42-
4326 < SideNav
44- ref = 'nav'
4527 { ...this . props }
4628 />
4729 < ArticleTopBar
48- ref = 'top'
4930 { ...this . props }
5031 />
5132 < ArticleList
52- ref = 'list'
5333 { ...this . props }
5434 />
5535 < ArticleDetail
56- ref = 'detail'
36+ { ...this . props }
37+ />
38+ < StatusBar
5739 { ...this . props }
5840 />
5941 </ div >
You can’t perform that action at this time.
0 commit comments