-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update Zendesk integration in react-thirdparty package
- Loading branch information
1 parent
0352cbc
commit 6365d10
Showing
7 changed files
with
14 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export * from "./useGoogleReCaptcha"; | ||
export * from "./useGoogleReCaptchaContext"; | ||
export * from "./GoogleReCaptcha"; | ||
export * from "./Context"; | ||
export * from "./Provider"; |
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
5 changes: 0 additions & 5 deletions
5
packages/react-thirdparty/recaptcha/useGoogleReCaptchaContext.ts
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
import { createContext, useContext } from "react"; | ||
|
||
export interface ZendeskContextProps { | ||
executeZendesk: ZendeskWidget; | ||
executeZendesk?: ZendeskWidget; | ||
} | ||
|
||
export const ZendeskContext = createContext<ZendeskContextProps | undefined>( | ||
undefined | ||
); | ||
export const ZendeskContext = createContext<ZendeskContextProps>({}); | ||
|
||
/** | ||
* Custom hook to use the Zendesk context. | ||
* @throws If used outside of a ZendeskProvider. | ||
* @returns The Zendesk context value. | ||
*/ | ||
export const useZendeskContext = (): ZendeskContextProps => { | ||
const context = useContext(ZendeskContext); | ||
if (!context) { | ||
throw new Error("useZendeskContext must be used within a ZendeskProvider"); | ||
} | ||
return context; | ||
}; | ||
export const useZendeskContext = () => useContext(ZendeskContext); |
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