-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.js
More file actions
50 lines (45 loc) · 1.24 KB
/
root.js
File metadata and controls
50 lines (45 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// External
import React from 'react';
import { connect } from 'react-redux';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
// Internal
import Dock from './dock';
import Footer from './footer';
import ReferenceWrapper from '../containers/reference-wrapper';
import KeyboardShortcuts from '../containers/keyboard-shortcuts';
import Trays from './trays';
import VisibleTrays from '../containers/visible-trays';
import WordHighlight from '../containers/word-highlight';
import styles from './root.scss';
class Root extends React.Component{
getBodyStyles() {
var bodyStyles = 'body { ';
bodyStyles += 'font-family: ' + this.props.settings.fontFamily + ';';
bodyStyles += 'font-size: ' + this.props.settings.fontSize + ';';
bodyStyles += '}';
return bodyStyles;
}
render() {
return (
<div className={ styles.root }>
<style>{ this.getBodyStyles() }</style>
<KeyboardShortcuts />
<WordHighlight word={ this.props.highlightedWord } />
<Trays>
<VisibleTrays />
</Trays>
<Dock />
<ReferenceWrapper />
<Footer />
</div>
);
}
}
const mapStateToProps = ( state, ownProps ) => {
return {
settings: state.settings
};
};
export default connect(
mapStateToProps,
)( withStyles( styles )( Root ) );