Skip to content

Commit 6087de5

Browse files
committed
deps(Algolia): upgrade React InstantSearch
1 parent 11c7305 commit 6087de5

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

app/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ApolloProvider } from '@apollo/client'
66
// Import libs
77
import React from 'react'
88
import { I18nextProvider } from 'react-i18next'
9-
import { Configure, Index, InstantSearch } from 'react-instantsearch-dom'
9+
import { Configure, Index, InstantSearch } from 'react-instantsearch'
1010
import { Provider as ReduxProvider } from 'react-redux'
1111
import { polyfill as smoothSrollPolyfill } from 'smoothscroll-polyfill'
1212
import { ThemeProvider } from 'styled-components'

app/components/Search/IndexSearchEntriesCount.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { get } from 'lodash'
22
import PropTypes from 'prop-types'
33
import React from 'react'
4-
import { connectStateResults, Index } from 'react-instantsearch-dom'
4+
import { connectStateResults, Index } from 'react-instantsearch'
55

66
const SearchResultsCount = connectStateResults(({ searchResults }) => {
77
return get(searchResults, 'nbHits', 0)

app/components/Search/SearchBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { withNamespaces } from 'react-i18next'
3-
import { SearchBox as AlgoliaSearchBox } from 'react-instantsearch-dom'
3+
import { SearchBox as AlgoliaSearchBox } from 'react-instantsearch'
44
import { withRouter } from 'react-router'
55
import styled from 'styled-components'
66

app/components/Search/SearchPage.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { capitalize } from 'lodash'
22
import React from 'react'
33
import { Trans, withNamespaces } from 'react-i18next'
4-
import { connectSearchBox, Index, InfiniteHits } from 'react-instantsearch-dom'
4+
import { Index, InfiniteHits, useSearchBox } from 'react-instantsearch'
55
import { Link } from 'react-router-dom'
66
import styled from 'styled-components'
77
import { Search as SearchIcon } from 'styled-icons/fa-solid'
@@ -173,4 +173,14 @@ const SearchPage = ({ t, refine, match, location }) => {
173173
)
174174
}
175175

176+
function connectSearchBox(Component) {
177+
const SearchBox = (props) => {
178+
const data = useSearchBox(props)
179+
180+
return <Component {...props} {...data} />
181+
}
182+
183+
return SearchBox
184+
}
185+
176186
export default withNamespaces('main')(connectSearchBox(SearchPage))

0 commit comments

Comments
 (0)