2017-11-06 18:35:04 +00:00
|
|
|
const React = require('react');
|
|
|
|
const { connect } = require('react-redux');
|
2017-11-06 20:54:58 +00:00
|
|
|
const { Header } = require('./Header.min.js');
|
2017-11-06 18:35:04 +00:00
|
|
|
const { SideBar } = require('./SideBar.min.js');
|
|
|
|
const { NoteList } = require('./NoteList.min.js');
|
|
|
|
const { NoteText } = require('./NoteText.min.js');
|
2017-11-06 20:54:58 +00:00
|
|
|
const { themeStyle } = require('../theme.js');
|
2017-11-07 21:11:14 +00:00
|
|
|
const layoutUtils = require('lib/layout-utils.js');
|
2017-11-06 18:35:04 +00:00
|
|
|
|
|
|
|
class MainScreenComponent extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const style = this.props.style;
|
2017-11-06 20:54:58 +00:00
|
|
|
const theme = themeStyle(this.props.theme);
|
|
|
|
|
|
|
|
const headerStyle = {
|
|
|
|
width: style.width,
|
|
|
|
};
|
|
|
|
|
|
|
|
const rowHeight = style.height - theme.headerHeight;
|
2017-11-06 18:35:04 +00:00
|
|
|
|
2017-11-07 21:11:14 +00:00
|
|
|
const sideBarStyle = {
|
|
|
|
width: layoutUtils.size(style.width * .2, 100, 300),
|
2017-11-06 20:54:58 +00:00
|
|
|
height: rowHeight,
|
2017-11-06 18:35:04 +00:00
|
|
|
display: 'inline-block',
|
|
|
|
verticalAlign: 'top',
|
|
|
|
};
|
|
|
|
|
2017-11-07 21:11:14 +00:00
|
|
|
const noteListStyle = {
|
|
|
|
width: layoutUtils.size(style.width * .2, 100, 300),
|
2017-11-06 20:54:58 +00:00
|
|
|
height: rowHeight,
|
2017-11-06 18:35:04 +00:00
|
|
|
display: 'inline-block',
|
|
|
|
verticalAlign: 'top',
|
|
|
|
};
|
|
|
|
|
2017-11-07 21:11:14 +00:00
|
|
|
const noteTextStyle = {
|
|
|
|
width: layoutUtils.size(style.width - sideBarStyle.width - noteListStyle.width, 0),
|
2017-11-06 20:54:58 +00:00
|
|
|
height: rowHeight,
|
2017-11-06 18:35:04 +00:00
|
|
|
display: 'inline-block',
|
|
|
|
verticalAlign: 'top',
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div style={style}>
|
2017-11-06 20:54:58 +00:00
|
|
|
<Header style={headerStyle} showBackButton={false} />
|
|
|
|
<SideBar style={sideBarStyle} />
|
|
|
|
<NoteList itemHeight={40} style={noteListStyle} />
|
|
|
|
<NoteText style={noteTextStyle} />
|
2017-11-06 18:35:04 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
2017-11-06 20:54:58 +00:00
|
|
|
return {
|
|
|
|
theme: state.theme,
|
|
|
|
};
|
2017-11-06 18:35:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const MainScreen = connect(mapStateToProps)(MainScreenComponent);
|
|
|
|
|
|
|
|
module.exports = { MainScreen };
|