diff options
Diffstat (limited to 'src/features/todos/containers/TodosScreen.tsx')
-rw-r--r-- | src/features/todos/containers/TodosScreen.tsx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/features/todos/containers/TodosScreen.tsx b/src/features/todos/containers/TodosScreen.tsx new file mode 100644 index 000000000..17f61bd95 --- /dev/null +++ b/src/features/todos/containers/TodosScreen.tsx | |||
@@ -0,0 +1,49 @@ | |||
1 | import { Component, ReactElement } from 'react'; | ||
2 | import { observer, inject } from 'mobx-react'; | ||
3 | import TodosWebview from '../components/TodosWebview'; | ||
4 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | ||
5 | import { todosStore } from '..'; | ||
6 | import { TODOS_MIN_WIDTH } from '../../../config'; | ||
7 | import { todoActions } from '../actions'; | ||
8 | import { RealStores } from '../../../stores'; | ||
9 | |||
10 | interface IProps { | ||
11 | stores?: RealStores; | ||
12 | } | ||
13 | |||
14 | @inject('stores', 'actions') | ||
15 | @observer | ||
16 | class TodosScreen extends Component<IProps> { | ||
17 | render(): ReactElement | null { | ||
18 | const showTodoScreen = | ||
19 | !todosStore || | ||
20 | !todosStore.isFeatureActive || | ||
21 | todosStore.isTodosPanelForceHidden; | ||
22 | |||
23 | if (showTodoScreen) { | ||
24 | return null; | ||
25 | } | ||
26 | |||
27 | return ( | ||
28 | <ErrorBoundary> | ||
29 | <TodosWebview | ||
30 | isTodosServiceActive={ | ||
31 | this.props.stores!.services.isTodosServiceActive || false | ||
32 | } | ||
33 | isVisible={todosStore.isTodosPanelVisible} | ||
34 | // togglePanel={todoActions.toggleTodosPanel} // TODO - [TECH DEBT][PROP NOT USED IN COMPONENT] check it later | ||
35 | handleClientMessage={todoActions.handleClientMessage} | ||
36 | setTodosWebview={webview => todoActions.setTodosWebview(webview)} | ||
37 | width={todosStore.width} | ||
38 | minWidth={TODOS_MIN_WIDTH} | ||
39 | resize={width => todoActions.resize(width)} | ||
40 | userAgent={todosStore.userAgent} | ||
41 | todoUrl={todosStore.todoUrl} | ||
42 | isTodoUrlValid={todosStore.isTodoUrlValid} | ||
43 | /> | ||
44 | </ErrorBoundary> | ||
45 | ); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | export default TodosScreen; | ||