From 1286c6556115f80218a4828d29b288f56b3d795f Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 10 Dec 2017 11:13:08 +0100 Subject: Rename onType to onInputChange --- src/client/react/actions/search.js | 4 ++-- src/client/react/components/container/Search.js | 6 +++--- src/client/react/components/presentational/Search.jsx | 6 +++--- src/client/react/reducers/search.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/react/actions/search.js b/src/client/react/actions/search.js index 82db383..e50d851 100644 --- a/src/client/react/actions/search.js +++ b/src/client/react/actions/search.js @@ -1,5 +1,5 @@ // eslint-disable-next-line import/prefer-default-export -export const type = typedValue => ({ - type: 'SEARCH/TYPE', +export const inputChange = typedValue => ({ + type: 'SEARCH/INPUT_CHANGE', typedValue, }); diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js index ddfb0a6..2489084 100644 --- a/src/client/react/components/container/Search.js +++ b/src/client/react/components/container/Search.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { type } from '../../actions/search'; +import { inputChange } from '../../actions/search'; import PresentationalSearch from '../presentational/Search'; const mapStateToProps = state => ({ @@ -8,8 +8,8 @@ const mapStateToProps = state => ({ }); const mapDispatchToProps = dispatch => ({ - onType: (event) => { - dispatch(type(event.target.value)); + onInputChange: (event) => { + dispatch(inputChange(event.target.value)); }, }); diff --git a/src/client/react/components/presentational/Search.jsx b/src/client/react/components/presentational/Search.jsx index 1e00192..a713db4 100644 --- a/src/client/react/components/presentational/Search.jsx +++ b/src/client/react/components/presentational/Search.jsx @@ -1,10 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -const Search = ({ onType, value, results }) => ( +const Search = ({ onInputChange, value, results }) => (
@@ -15,7 +15,7 @@ const Search = ({ onType, value, results }) => ( ); Search.propTypes = { - onType: PropTypes.func.isRequired, + onInputChange: PropTypes.func.isRequired, value: PropTypes.string.isRequired, results: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string.require, diff --git a/src/client/react/reducers/search.js b/src/client/react/reducers/search.js index 05926c9..08be519 100644 --- a/src/client/react/reducers/search.js +++ b/src/client/react/reducers/search.js @@ -5,7 +5,7 @@ const DEFAULT_STATE = { const search = (state = DEFAULT_STATE, action) => { switch (action.type) { - case 'SEARCH/TYPE': + case 'SEARCH/INPUT_CHANGE': return { ...state, searchInput: action.typedValue, -- cgit v1.1