diff options
Diffstat (limited to 'src/features/todos/components')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index c06183e37..530a5b2a9 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer, inject } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import Webview from 'react-electron-web-view'; | 5 | import Webview from 'react-electron-web-view'; |
6 | import { Icon } from '@meetfranz/ui'; | 6 | import { Icon } from '@meetfranz/ui'; |
@@ -11,6 +11,8 @@ import * as environment from '../../../environment'; | |||
11 | import Appear from '../../../components/ui/effects/Appear'; | 11 | import Appear from '../../../components/ui/effects/Appear'; |
12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; | 12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; |
13 | 13 | ||
14 | import SettingsStore from '../../../stores/SettingsStore' | ||
15 | |||
14 | const OPEN_TODOS_BUTTON_SIZE = 45; | 16 | const OPEN_TODOS_BUTTON_SIZE = 45; |
15 | const CLOSE_TODOS_BUTTON_SIZE = 35; | 17 | const CLOSE_TODOS_BUTTON_SIZE = 35; |
16 | 18 | ||
@@ -127,7 +129,7 @@ const styles = theme => ({ | |||
127 | }, | 129 | }, |
128 | }); | 130 | }); |
129 | 131 | ||
130 | @injectSheet(styles) @observer | 132 | @injectSheet(styles) @observer @inject('stores') |
131 | class TodosWebview extends Component { | 133 | class TodosWebview extends Component { |
132 | static propTypes = { | 134 | static propTypes = { |
133 | classes: PropTypes.object.isRequired, | 135 | classes: PropTypes.object.isRequired, |
@@ -139,6 +141,9 @@ class TodosWebview extends Component { | |||
139 | width: PropTypes.number.isRequired, | 141 | width: PropTypes.number.isRequired, |
140 | minWidth: PropTypes.number.isRequired, | 142 | minWidth: PropTypes.number.isRequired, |
141 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, | 143 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, |
144 | stores: PropTypes.shape({ | ||
145 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
146 | }).isRequired, | ||
142 | }; | 147 | }; |
143 | 148 | ||
144 | state = { | 149 | state = { |
@@ -230,6 +235,7 @@ class TodosWebview extends Component { | |||
230 | isVisible, | 235 | isVisible, |
231 | togglePanel, | 236 | togglePanel, |
232 | isTodosIncludedInCurrentPlan, | 237 | isTodosIncludedInCurrentPlan, |
238 | stores, | ||
233 | } = this.props; | 239 | } = this.props; |
234 | 240 | ||
235 | const { | 241 | const { |
@@ -276,7 +282,7 @@ class TodosWebview extends Component { | |||
276 | partition="persist:todos" | 282 | partition="persist:todos" |
277 | preload="./features/todos/preload.js" | 283 | preload="./features/todos/preload.js" |
278 | ref={(webview) => { this.webview = webview ? webview.view : null; }} | 284 | ref={(webview) => { this.webview = webview ? webview.view : null; }} |
279 | src={environment.TODOS_FRONTEND} | 285 | src={ stores.settings.all.app.todoServer || environment.TODOS_FRONTEND} |
280 | /> | 286 | /> |
281 | ) : ( | 287 | ) : ( |
282 | <Appear> | 288 | <Appear> |