From 5818e579f4baf6326250ac8d94d225675b7d8165 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 1 Aug 2019 14:12:30 +0200 Subject: Fix eslint issues --- src/features/todos/actions.js | 2 +- src/features/todos/containers/TodosScreen.js | 23 ++++++++--------------- src/features/todos/index.js | 10 +++++----- 3 files changed, 14 insertions(+), 21 deletions(-) (limited to 'src/features/todos') 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({ width: PropTypes.number.isRequired, }, setTodosWebview: { - webview: PropTypes.element.isRequired, + webview: PropTypes.instanceOf(Element).isRequired, }, handleHostMessage: { 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'; import TodosWebview from '../components/TodosWebview'; import ErrorBoundary from '../../../components/util/ErrorBoundary'; import UserStore from '../../../stores/UserStore'; -import TodoStore from '../store'; -import { TODOS_MIN_WIDTH } from '..'; +import { TODOS_MIN_WIDTH, todosStore } from '..'; +import { todoActions } from '../actions'; -@inject('stores', 'actions') @observer +@inject('stores') @observer class TodosScreen extends Component { static propTypes = { stores: PropTypes.shape({ user: PropTypes.instanceOf(UserStore).isRequired, - todos: PropTypes.instanceOf(TodoStore).isRequired, - }).isRequired, - actions: PropTypes.shape({ - todos: PropTypes.shape({ - resize: PropTypes.func.isRequired, - handleIPCMessage: PropTypes.func.isRequired, - }), }).isRequired, }; render() { - const { stores, actions } = this.props; + const { stores } = this.props; if (!stores.todos || !stores.todos.isFeatureActive) { return null; @@ -34,11 +27,11 @@ class TodosScreen extends Component { actions.todos.setTodosWebview({ webview })} - width={stores.todos.width} + handleClientMessage={todoActions.handleClientMessage} + setTodosWebview={webview => todoActions.setTodosWebview({ webview })} + width={todosStore.width} minWidth={TODOS_MIN_WIDTH} - resize={width => actions.todos.resize({ width })} + resize={width => todoActions.resize({ width })} /> ); 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'; export const DEFAULT_TODOS_WIDTH = 300; export const TODOS_MIN_WIDTH = 200; -export const todoStore = new TodoStore(); +export const todosStore = new TodoStore(); export default function initTodos(stores, actions) { - stores.todos = todoStore; + stores.todos = todosStore; const { features } = stores; // Toggle todos feature @@ -20,10 +20,10 @@ export default function initTodos(stores, actions) { (isEnabled) => { if (isEnabled) { debug('Initializing `todos` feature'); - todoStore.start(stores, actions); - } else if (todoStore.isFeatureActive) { + todosStore.start(stores, actions); + } else if (todosStore.isFeatureActive) { debug('Disabling `todos` feature'); - todoStore.stop(); + todosStore.stop(); } }, { -- cgit v1.2.3-54-g00ecf