Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
event.stopPropagation();
clickAction(suggestion._id)
}
return
<div>
</div>
}
const AutocompleteTextbox = connectAutoComplete(
({
// From connectAutoComplete HoC
hits, currentRefinement, refine,
// FromSearchAutoComplete
onSuggestionSelected, placeholder, renderSuggestion, renderInputComponent
}) => {
return (
refine(value)}
onSuggestionsClearRequested={() => refine('')}
getSuggestionValue={hit => hit.title}
renderInputComponent={renderInputComponent}
renderSuggestion={renderSuggestion}
inputProps={{
hit,
// Downshift supplies onClick
onVersionChange(version) {
onHitVersionChange(hit, version);
},
})}
/>
))}
)}
);
}
const ConnectedAutoComplete = connectAutoComplete(RawAutoComplete);
type Props = {
onConfirm: (dependency: string, version: string) => Promise,
};
export default class SearchDependencies extends React.PureComponent {
props: Props;
hitToVersionMap = new Map();
handleSelect = hit => {
let version = this.hitToVersionMap.get(hit);
if (!version && hit.tags) {
version = hit.tags.latest;
}
const algoliaAppId = getSetting('algolia.appId')
const algoliaSearchKey = getSetting('algolia.searchKey')
return
<div>
</div>
}
const AutoComplete = connectAutoComplete(
({ hits, currentRefinement, refine, clickAction }) =>
refine(value)}
onSuggestionsClearRequested={() => refine('')}
getSuggestionValue={hit => hit.title}
renderSuggestion={hit =>
}
inputProps={{
placeholder: 'Search for sequences',
value: currentRefinement,
onChange: () => {},
}}
highlightFirstSuggestion
/>
);
import React from 'react';
import { InstantSearch, Configure, PoweredBy } from 'react-instantsearch/dom';
import { connectAutoComplete } from 'react-instantsearch/connectors';
import Style from 'app/pages/Search/search';
import DependenciesCSS from './dependencies';
import RawAutoComplete from './RawAutoComplete';
const ConnectedAutoComplete = connectAutoComplete(RawAutoComplete);
export default class SearchDependencies extends React.PureComponent {
hitToVersionMap = new Map();
handleSelect = hit => {
let version = this.hitToVersionMap.get(hit);
if (!version && hit.tags) {
version = hit.tags.latest;
}
this.props.onConfirm(hit.name, version);
};
handleManualSelect = hitName => {
if (!hitName) {
return (
);
}
}
const ConnectedSearchBox = connectAutoComplete(SearchBox2);
const RenderHit = ({ hit }) => (
<button>
</button>
);
RenderHit.propTypes = {
hit: PropTypes.object.isRequired
fontWeight: selectedItem === item ? 'bold' : 'normal',
},
})}
>
))}
)}
)}
)
}
const AutoCompleteWithData = connectAutoComplete(RawAutoComplete)
function Examples() {
return (
Algolia{' '}
<a href="https://community.algolia.com/react-instantsearch/">
React InstantSearch
</a>{' '}
example
)
const algoliaAppId = getSetting('algolia.appId')
const algoliaSearchKey = getSetting('algolia.searchKey')
return
<div>
</div>
}
const AutoComplete = connectAutoComplete(
({ hits, currentRefinement, refine, clickAction}) =>
{
const onSuggestionSelected = (event, { suggestion }) => {
event.preventDefault();
event.stopPropagation();
clickAction(suggestion._id)
}
return (
refine(value)}
onSuggestionsClearRequested={() => refine('')}
getSuggestionValue={hit => hit.title}
renderSuggestion={hit =>
}