Skip to content

Commit

Permalink
feat(docsearch): update missing results issue link
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Aug 6, 2020
1 parent 57284e4 commit b904ff6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/DocSearchModal.tsx
Expand Up @@ -362,6 +362,7 @@ export function DocSearchModal({
<div className="DocSearch-Dropdown" ref={dropdownRef}>
<ScreenState
{...autocomplete}
indexName={indexName}
state={state}
hitComponent={hitComponent}
resultsFooterComponent={resultsFooterComponent}
Expand Down
3 changes: 2 additions & 1 deletion src/NoResultsScreen.tsx
Expand Up @@ -16,6 +16,7 @@ interface NoResultsScreenProps
> {
state: AutocompleteState<InternalDocSearchHit>;
inputRef: React.MutableRefObject<null | HTMLInputElement>;
indexName: string;
}

export function NoResultsScreen(props: NoResultsScreenProps) {
Expand Down Expand Up @@ -61,7 +62,7 @@ export function NoResultsScreen(props: NoResultsScreenProps) {
<p className="DocSearch-Help">
Believe this query should return results?{' '}
<a
href="https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md"
href={`https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[${props.indexName}]+Missing+results+for+query+"${props.state.query}"`}
target="_blank"
rel="noopener noreferrer"
>
Expand Down
3 changes: 3 additions & 0 deletions src/ScreenState.tsx
Expand Up @@ -4,6 +4,7 @@ import {
} from '@francoischalifour/autocomplete-core';
import React from 'react';

import { DocSearchProps } from './DocSearch';
import { ErrorScreen } from './ErrorScreen';
import { NoResultsScreen } from './NoResultsScreen';
import { ResultsScreen } from './ResultsScreen';
Expand All @@ -23,6 +24,8 @@ interface ScreenStateProps<TItem>
favoriteSearches: StoredSearchPlugin<StoredDocSearchHit>;
onItemClick(item: StoredDocSearchHit): void;
inputRef: React.MutableRefObject<null | HTMLInputElement>;
hitComponent: DocSearchProps['hitComponent'];
indexName: DocSearchProps['indexName'];
}

export const ScreenState = React.memo(
Expand Down

0 comments on commit b904ff6

Please sign in to comment.