mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
add StatusBar to Main
This commit is contained in:
@@ -1,24 +1,15 @@
|
||||
const electron = require('electron')
|
||||
import { connect } from 'react-redux'
|
||||
const ipc = electron.ipcRenderer
|
||||
import React, { PropTypes } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import SideNav from './SideNav'
|
||||
import ArticleTopBar from './ArticleTopBar'
|
||||
import ArticleList from './ArticleList'
|
||||
import ArticleDetail from './ArticleDetail'
|
||||
import Repository from 'browser/lib/Repository'
|
||||
import StatusBar from './StatusBar'
|
||||
|
||||
class Main extends React.Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
this.state = {updateAvailable: false}
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
let { dispatch } = this.props
|
||||
ipc.on('update-available', function (message) {
|
||||
this.setState({updateAvailable: true})
|
||||
}.bind(this))
|
||||
|
||||
// Reload all data
|
||||
Repository.loadAll()
|
||||
@@ -27,33 +18,24 @@ class Main extends React.Component {
|
||||
})
|
||||
}
|
||||
|
||||
updateApp () {
|
||||
ipc.send('update-app', 'Deal with it.')
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<div
|
||||
className='Main'
|
||||
>
|
||||
{this.state.updateAvailable ? (
|
||||
<button onClick={this.updateApp} className='appUpdateButton'><i className='fa fa-cloud-download'/> Update available!</button>
|
||||
) : null}
|
||||
|
||||
<SideNav
|
||||
ref='nav'
|
||||
{...this.props}
|
||||
/>
|
||||
<ArticleTopBar
|
||||
ref='top'
|
||||
{...this.props}
|
||||
/>
|
||||
<ArticleList
|
||||
ref='list'
|
||||
{...this.props}
|
||||
/>
|
||||
<ArticleDetail
|
||||
ref='detail'
|
||||
{...this.props}
|
||||
/>
|
||||
<StatusBar
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user