diff options
Diffstat (limited to 'src/features/todos/containers')
-rw-r--r-- | src/features/todos/containers/TodosScreen.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/features/todos/containers/TodosScreen.js b/src/features/todos/containers/TodosScreen.js new file mode 100644 index 000000000..a5da0b014 --- /dev/null +++ b/src/features/todos/containers/TodosScreen.js | |||
@@ -0,0 +1,41 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import { observer, inject } from 'mobx-react'; | ||
3 | import PropTypes from 'prop-types'; | ||
4 | |||
5 | import FeaturesStore from '../../../stores/FeaturesStore'; | ||
6 | import TodosWebview from '../components/TodosWebview'; | ||
7 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | ||
8 | import { TODOS_MIN_WIDTH, todosStore } from '..'; | ||
9 | import { todoActions } from '../actions'; | ||
10 | |||
11 | @inject('stores', 'actions') @observer | ||
12 | class TodosScreen extends Component { | ||
13 | render() { | ||
14 | if (!todosStore || !todosStore.isFeatureActive || todosStore.isTodosPanelForceHidden) { | ||
15 | return null; | ||
16 | } | ||
17 | |||
18 | return ( | ||
19 | <ErrorBoundary> | ||
20 | <TodosWebview | ||
21 | isVisible={todosStore.isTodosPanelVisible} | ||
22 | togglePanel={todoActions.toggleTodosPanel} | ||
23 | handleClientMessage={todoActions.handleClientMessage} | ||
24 | setTodosWebview={webview => todoActions.setTodosWebview({ webview })} | ||
25 | width={todosStore.width} | ||
26 | minWidth={TODOS_MIN_WIDTH} | ||
27 | resize={width => todoActions.resize({ width })} | ||
28 | isTodosIncludedInCurrentPlan={this.props.stores.features.features.isTodosIncludedInCurrentPlan || false} | ||
29 | /> | ||
30 | </ErrorBoundary> | ||
31 | ); | ||
32 | } | ||
33 | } | ||
34 | |||
35 | export default TodosScreen; | ||
36 | |||
37 | TodosScreen.wrappedComponent.propTypes = { | ||
38 | stores: PropTypes.shape({ | ||
39 | features: PropTypes.instanceOf(FeaturesStore).isRequired, | ||
40 | }).isRequired, | ||
41 | }; | ||