lbry-desktop/js/app.js
2016-04-09 20:03:23 -04:00

31 lines
679 B
JavaScript

var appStyles = {
width: '800px',
marginLeft: 'auto',
marginRight: 'auto',
};
var App = React.createClass({
getInitialState: function() {
return {
viewingPage: window.location.search === '?settings' ? 'settings' : 'home'
}
},
componentDidMount: function() {
lbry.getStartNotice(function(notice) {
if (notice) {
alert(notice);
}
});
},
render: function() {
if (this.state.viewingPage == 'home') {
var content = <HomePage />;
} else if (this.state.viewingPage == 'settings') {
var content = <SettingsPage />;
}
return (
<div style={appStyles}>
{content}
</div>
);
}
});