import * as searchBoxActions from '../actions/searchBoxActions'
import * as trackActions from '../actions/trackActions'
import * as playlistActions from '../actions/playlistActions'

const initialState = {
  source: 'youtube',
  searchResultVisible: false,
  searchResults: [],
  dropdownIndex: 0
}
export default (state = initialState, action) => {
    switch (action.type) {
        case searchBoxActions.SET_SEARCH_SOURCE:
          return {
            ...state,
            source: action.source
          }
        case searchBoxActions.SET_SEARCH_RESULT_VISIBILITY:
          return {
            ...state,
            searchResultVisible: action.visible
          }
        case searchBoxActions.SET_SEARCH_QUERY:
          let searchResults = state.searchResults
          let searchResultsVisible = true
          if (action.query.trim() === "") {
            searchResults = []
            searchResultsVisible = false
          }
          return {
            ...state,
            searchQuery: action.query,
            searchResults,
            searchResultsVisible
          }
        case searchBoxActions.RECEIVE_SEARCH_RESULTS:
          return {
            ...state,
            searchResults: action.results
          }
        case searchBoxActions.NAVIGATE_DROPDOWN:
          let newValue = state.dropdownIndex + action.direction
          newValue %= state.searchResults.length
          if (newValue < 0) {
            newValue = newValue + state.searchResults.length
          }
          return {
            ...state,
            dropdownIndex: newValue
          }
        case trackActions.TRACK_ADD_NEW: case playlistActions.PLAYLIST_ADD_NEW:
          return {
            ...initialState,
            source: state.source
          }
        default:
            return state
    }
}

@@ -783,33 +783,32 @@
 let searchResult
-s
 Visible = true%0A 
@@ -806,16 +806,16 @@
  = true%0A
+
         
@@ -901,25 +901,24 @@
 searchResult
-s
 Visible = fa
@@ -1064,17 +1064,16 @@
 chResult
-s
 Visible%0A
@@ -1149,32 +1149,32 @@
        return %7B%0A
-
             ...s
@@ -1171,32 +1171,71 @@
       ...state,%0A
+            searchResultVisible: true,%0A
             sear

Variable is called searchResultVisible not searchResultsVisible