-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Answers -> Search 2: rename imports (#144)
* renamed answers-headless imports * Automated update to THIRD-PARTY-NOTICES from github action's 3rd party notices check * version update * update license Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e0b5013
commit 4db446b
Showing
14 changed files
with
77 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { AnswersHeadless } from '@yext/answers-headless'; | ||
import { SearchHeadless } from '@yext/search-headless'; | ||
import { createContext } from 'react'; | ||
|
||
// The default is empty because we don't know the user's config yet | ||
export const SearchHeadlessContext = createContext<AnswersHeadless>({} as AnswersHeadless); | ||
export const SearchHeadlessContext = createContext<SearchHeadless>({} as SearchHeadless); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { AnswersHeadless } from '@yext/answers-headless'; | ||
import { SearchHeadless } from '@yext/search-headless'; | ||
import { useContext } from 'react'; | ||
import { SearchHeadlessContext } from './SearchHeadlessContext'; | ||
|
||
export type SearchActions = AnswersHeadless; | ||
export type SearchActions = SearchHeadless; | ||
|
||
export function useSearchActions(): SearchActions { | ||
const answersHeadless = useContext(SearchHeadlessContext); | ||
if (answersHeadless.state === undefined) { | ||
const searchHeadless = useContext(SearchHeadlessContext); | ||
if (searchHeadless.state === undefined) { | ||
throw new Error('Attempted to call useSearchActions() outside of SearchHeadlessProvider.' | ||
+ ' Please ensure that \'useSearchActions()\' is called within an SearchHeadlessProvider component.'); | ||
} | ||
return answersHeadless; | ||
return searchHeadless; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters