aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos/containers/TodosScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/todos/containers/TodosScreen.js')
-rw-r--r--src/features/todos/containers/TodosScreen.js45
1 files changed, 45 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..0759c22db
--- /dev/null
+++ b/src/features/todos/containers/TodosScreen.js
@@ -0,0 +1,45 @@
1import React, { Component } from 'react';
2import { inject, observer } from 'mobx-react';
3import PropTypes from 'prop-types';
4
5import TodosWebview from '../components/TodosWebview';
6import ErrorBoundary from '../../../components/util/ErrorBoundary';
7import UserStore from '../../../stores/UserStore';
8import TodoStore from '../store';
9import { TODOS_MIN_WIDTH } from '..';
10
11@inject('stores', 'actions') @observer
12class TodosScreen extends Component {
13 static propTypes = {
14 stores: PropTypes.shape({
15 user: PropTypes.instanceOf(UserStore).isRequired,
16 todos: PropTypes.instanceOf(TodoStore).isRequired,
17 }).isRequired,
18 actions: PropTypes.shape({
19 todos: PropTypes.shape({
20 resize: PropTypes.func.isRequired,
21 }),
22 }).isRequired,
23 };
24
25 render() {
26 const { stores, actions } = this.props;
27
28 if (!stores.todos || !stores.todos.isFeatureActive) {
29 return null;
30 }
31
32 return (
33 <ErrorBoundary>
34 <TodosWebview
35 authToken={stores.user.authToken}
36 width={stores.todos.width}
37 minWidth={TODOS_MIN_WIDTH}
38 resize={width => actions.todos.resize({ width })}
39 />
40 </ErrorBoundary>
41 );
42 }
43}
44
45export default TodosScreen;