diff options
Diffstat (limited to 'src/features/todos/components')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js new file mode 100644 index 000000000..54208d7ad --- /dev/null +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -0,0 +1,41 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import injectSheet from 'react-jss'; | ||
5 | import Webview from 'react-electron-web-view'; | ||
6 | |||
7 | const styles = theme => ({ | ||
8 | root: { | ||
9 | background: theme.colorBackground, | ||
10 | height: '100%', | ||
11 | width: 300, | ||
12 | position: 'absolute', | ||
13 | top: 0, | ||
14 | right: 0, | ||
15 | }, | ||
16 | webview: { | ||
17 | height: '100%', | ||
18 | }, | ||
19 | }); | ||
20 | |||
21 | @injectSheet(styles) @observer | ||
22 | class TodosWebview extends Component { | ||
23 | static propTypes = { | ||
24 | classes: PropTypes.object.isRequired, | ||
25 | authToken: PropTypes.string.isRequired, | ||
26 | }; | ||
27 | |||
28 | render() { | ||
29 | const { authToken, classes } = this.props; | ||
30 | return ( | ||
31 | <div className={classes.root}> | ||
32 | <Webview | ||
33 | className={classes.webview} | ||
34 | src={`http://localhost:4000?authToken=${authToken}`} | ||
35 | /> | ||
36 | </div> | ||
37 | ); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | export default TodosWebview; | ||