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