diff options
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 42 |
1 files changed, 42 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..7e97c7f71 --- /dev/null +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -0,0 +1,42 @@ | |||
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 | import * as environment from '../../../environment'; | ||
7 | |||
8 | const styles = theme => ({ | ||
9 | root: { | ||
10 | background: theme.colorBackground, | ||
11 | height: '100%', | ||
12 | width: 300, | ||
13 | position: 'absolute', | ||
14 | top: 0, | ||
15 | right: 0, | ||
16 | }, | ||
17 | webview: { | ||
18 | height: '100%', | ||
19 | }, | ||
20 | }); | ||
21 | |||
22 | @injectSheet(styles) @observer | ||
23 | class TodosWebview extends Component { | ||
24 | static propTypes = { | ||
25 | classes: PropTypes.object.isRequired, | ||
26 | authToken: PropTypes.string.isRequired, | ||
27 | }; | ||
28 | |||
29 | render() { | ||
30 | const { authToken, classes } = this.props; | ||
31 | return ( | ||
32 | <div className={classes.root}> | ||
33 | <Webview | ||
34 | className={classes.webview} | ||
35 | src={`${environment.TODOS_FRONTEND}?authToken=${authToken}`} | ||
36 | /> | ||
37 | </div> | ||
38 | ); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | export default TodosWebview; | ||