-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
call stripe logout when logging out of Furever (#103)
* add logout * use context to retrieve connect instance
- Loading branch information
1 parent
00effe0
commit 330786d
Showing
3 changed files
with
34 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, {createContext, useContext} from 'react'; | ||
import {StripeConnectInstance} from '@stripe/connect-js'; | ||
|
||
type IConnectJSContext = { | ||
connectInstance?: StripeConnectInstance; | ||
}; | ||
|
||
const ConnectJSContext = createContext<IConnectJSContext>({}); | ||
|
||
export const useConnectJSContext = () => { | ||
const context = useContext(ConnectJSContext); | ||
return context; | ||
}; | ||
|
||
export const ConnectJSProvider = ({ | ||
children, | ||
connectInstance, | ||
}: { | ||
children: React.ReactNode; | ||
connectInstance?: StripeConnectInstance; | ||
}) => { | ||
return ( | ||
<ConnectJSContext.Provider value={{connectInstance}}> | ||
{children} | ||
</ConnectJSContext.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