lbry-desktop/ui/js/component/app/view.jsx

43 lines
1,016 B
React
Raw Normal View History

2017-04-07 07:15:22 +02:00
import React from 'react'
import Router from 'component/router'
2017-04-22 15:17:01 +02:00
import Header from 'component/header';
2017-04-07 07:15:22 +02:00
import ErrorModal from 'component/errorModal'
import DownloadingModal from 'component/downloadingModal'
import UpgradeModal from 'component/upgradeModal'
2017-05-15 18:34:33 +02:00
import lbry from 'lbry'
import {Line} from 'rc-progress'
2017-04-07 07:15:22 +02:00
2017-05-04 05:44:08 +02:00
class App extends React.Component {
componentWillMount() {
2017-04-07 07:15:22 +02:00
document.addEventListener('unhandledError', (event) => {
this.props.alertError(event.detail);
});
if (!this.props.upgradeSkipped) {
this.props.checkUpgradeAvailable()
}
2017-05-15 18:34:33 +02:00
lbry.balanceSubscribe((balance) => {
this.props.updateBalance(balance)
})
2017-05-31 12:34:39 +02:00
}
2017-05-04 05:44:08 +02:00
render() {
2017-04-07 07:15:22 +02:00
const {
modal,
} = this.props
2017-05-04 05:44:08 +02:00
return <div id="window">
<Header />
2017-05-03 01:49:02 +02:00
<div id="main-content">
2017-04-21 04:31:50 +02:00
<Router />
</div>
{modal == 'upgrade' && <UpgradeModal />}
{modal == 'downloading' && <DownloadingModal />}
{modal == 'error' && <ErrorModal />}
</div>
2017-04-07 07:15:22 +02:00
}
2017-05-04 05:44:08 +02:00
}
2017-04-07 07:15:22 +02:00
export default App