aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-08-01 14:12:30 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-08-01 14:12:30 +0200
commit5818e579f4baf6326250ac8d94d225675b7d8165 (patch)
tree296f14b506838b0f865a02d16788fac2e9aafecc /src/features/todos
parentadd updated i18n messages (diff)
downloadferdium-app-5818e579f4baf6326250ac8d94d225675b7d8165.tar.gz
ferdium-app-5818e579f4baf6326250ac8d94d225675b7d8165.tar.zst
ferdium-app-5818e579f4baf6326250ac8d94d225675b7d8165.zip
Fix eslint issues
Diffstat (limited to 'src/features/todos')
-rw-r--r--src/features/todos/actions.js2
-rw-r--r--src/features/todos/containers/TodosScreen.js23
-rw-r--r--src/features/todos/index.js10
3 files changed, 14 insertions, 21 deletions
diff --git a/src/features/todos/actions.js b/src/features/todos/actions.js
index 696568f7f..a6090a259 100644
--- a/src/features/todos/actions.js
+++ b/src/features/todos/actions.js
@@ -6,7 +6,7 @@ export const todoActions = createActionsFromDefinitions({
6 width: PropTypes.number.isRequired, 6 width: PropTypes.number.isRequired,
7 }, 7 },
8 setTodosWebview: { 8 setTodosWebview: {
9 webview: PropTypes.element.isRequired, 9 webview: PropTypes.instanceOf(Element).isRequired,
10 }, 10 },
11 handleHostMessage: { 11 handleHostMessage: {
12 action: PropTypes.string.isRequired, 12 action: PropTypes.string.isRequired,
diff --git a/src/features/todos/containers/TodosScreen.js b/src/features/todos/containers/TodosScreen.js
index 5b7c4531b..2b81bd728 100644
--- a/src/features/todos/containers/TodosScreen.js
+++ b/src/features/todos/containers/TodosScreen.js
@@ -5,26 +5,19 @@ import PropTypes from 'prop-types';
5import TodosWebview from '../components/TodosWebview'; 5import TodosWebview from '../components/TodosWebview';
6import ErrorBoundary from '../../../components/util/ErrorBoundary'; 6import ErrorBoundary from '../../../components/util/ErrorBoundary';
7import UserStore from '../../../stores/UserStore'; 7import UserStore from '../../../stores/UserStore';
8import TodoStore from '../store'; 8import { TODOS_MIN_WIDTH, todosStore } from '..';
9import { TODOS_MIN_WIDTH } from '..'; 9import { todoActions } from '../actions';
10 10
11@inject('stores', 'actions') @observer 11@inject('stores') @observer
12class TodosScreen extends Component { 12class TodosScreen extends Component {
13 static propTypes = { 13 static propTypes = {
14 stores: PropTypes.shape({ 14 stores: PropTypes.shape({
15 user: PropTypes.instanceOf(UserStore).isRequired, 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 handleIPCMessage: PropTypes.func.isRequired,
22 }),
23 }).isRequired, 16 }).isRequired,
24 }; 17 };
25 18
26 render() { 19 render() {
27 const { stores, actions } = this.props; 20 const { stores } = this.props;
28 21
29 if (!stores.todos || !stores.todos.isFeatureActive) { 22 if (!stores.todos || !stores.todos.isFeatureActive) {
30 return null; 23 return null;
@@ -34,11 +27,11 @@ class TodosScreen extends Component {
34 <ErrorBoundary> 27 <ErrorBoundary>
35 <TodosWebview 28 <TodosWebview
36 authToken={stores.user.authToken} 29 authToken={stores.user.authToken}
37 handleClientMessage={actions.todos.handleClientMessage} 30 handleClientMessage={todoActions.handleClientMessage}
38 setTodosWebview={webview => actions.todos.setTodosWebview({ webview })} 31 setTodosWebview={webview => todoActions.setTodosWebview({ webview })}
39 width={stores.todos.width} 32 width={todosStore.width}
40 minWidth={TODOS_MIN_WIDTH} 33 minWidth={TODOS_MIN_WIDTH}
41 resize={width => actions.todos.resize({ width })} 34 resize={width => todoActions.resize({ width })}
42 /> 35 />
43 </ErrorBoundary> 36 </ErrorBoundary>
44 ); 37 );
diff --git a/src/features/todos/index.js b/src/features/todos/index.js
index 0dfd35c78..f741561d6 100644
--- a/src/features/todos/index.js
+++ b/src/features/todos/index.js
@@ -8,10 +8,10 @@ export const GA_CATEGORY_TODOS = 'Todos';
8export const DEFAULT_TODOS_WIDTH = 300; 8export const DEFAULT_TODOS_WIDTH = 300;
9export const TODOS_MIN_WIDTH = 200; 9export const TODOS_MIN_WIDTH = 200;
10 10
11export const todoStore = new TodoStore(); 11export const todosStore = new TodoStore();
12 12
13export default function initTodos(stores, actions) { 13export default function initTodos(stores, actions) {
14 stores.todos = todoStore; 14 stores.todos = todosStore;
15 const { features } = stores; 15 const { features } = stores;
16 16
17 // Toggle todos feature 17 // Toggle todos feature
@@ -20,10 +20,10 @@ export default function initTodos(stores, actions) {
20 (isEnabled) => { 20 (isEnabled) => {
21 if (isEnabled) { 21 if (isEnabled) {
22 debug('Initializing `todos` feature'); 22 debug('Initializing `todos` feature');
23 todoStore.start(stores, actions); 23 todosStore.start(stores, actions);
24 } else if (todoStore.isFeatureActive) { 24 } else if (todosStore.isFeatureActive) {
25 debug('Disabling `todos` feature'); 25 debug('Disabling `todos` feature');
26 todoStore.stop(); 26 todosStore.stop();
27 } 27 }
28 }, 28 },
29 { 29 {