1- import React , { useState , useContext } from 'react' ;
1+ import React , { useState } from 'react' ;
22import './SearchInput.scss' ;
3- import { ReduxTestCaseContext } from '../../context/reducers/reduxTestCaseReducer' ;
43
54const SearchInput = ( {
65 dispatch,
@@ -17,8 +16,6 @@ const SearchInput = ({
1716 const [ filteredOptions , setFilteredOptions ] = useState ( [ ] ) ;
1817 const [ showOptions , setShowOptions ] = useState ( false ) ;
1918 const [ userInput , setUserInput ] = useState ( '' ) ;
20- const [ , dispatchToReduxTestCase ] = useContext ( ReduxTestCaseContext ) ;
21-
2219 const handleChange = ( e ) => {
2320 const input = e . currentTarget . value ;
2421
@@ -41,12 +38,8 @@ const SearchInput = ({
4138 const selectedOption = e . target . type ;
4239 const filePath = filePathMap [ selectedOption ] || '' ;
4340 if ( updateTypesFilePath ) {
44- if ( dispatchToReduxTestCase === dispatch ) {
45- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'reducer' ) ) ;
46- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'async' ) ) ;
47- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'action-creator' ) ) ;
48- } else dispatch ( updateTypesFilePath ( selectedOption , filePath , type ) ) ;
49- } //type));
41+ dispatch ( updateTypesFilePath ( selectedOption , filePath , type ) ) ;
42+ }
5043 if ( updateActionsFilePath ) dispatch ( updateActionsFilePath ( selectedOption , filePath , type ) ) ;
5144 if ( action ) dispatch ( action ( selectedOption , filePath ) ) ;
5245 } ;
@@ -60,12 +53,8 @@ const SearchInput = ({
6053 const filePath = filePathMap [ selectedOption ] || '' ;
6154 if ( action ) dispatch ( action ( selectedOption , filePath ) ) ;
6255 if ( updateTypesFilePath ) {
63- if ( dispatchToReduxTestCase === dispatch ) {
64- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'reducer' ) ) ;
65- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'async' ) ) ;
66- dispatch ( updateTypesFilePath ( selectedOption , filePath , 'action-creator' ) ) ;
67- } else dispatch ( updateTypesFilePath ( selectedOption , filePath , type ) ) ;
68- } //type));
56+ dispatch ( updateTypesFilePath ( selectedOption , filePath , type ) ) ;
57+ }
6958 } else if ( e . keyCode === 38 ) {
7059 if ( activeOption === 0 ) {
7160 return ;
0 commit comments