Your commit message
This commit is contained in:
16
src/contexts/ImpersonateUserContext.jsx
Normal file
16
src/contexts/ImpersonateUserContext.jsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createContext, useContext, useState } from 'react'
|
||||
|
||||
const ImpersonateUserContext = createContext()
|
||||
|
||||
export const useImpersonateUser = () => useContext(ImpersonateUserContext)
|
||||
|
||||
export const ImpersonateUserProvider = ({ children }) => {
|
||||
const [impersonatedUser, setImpersonatedUser] = useState(null)
|
||||
return (
|
||||
<ImpersonateUserContext.Provider
|
||||
value={{ impersonatedUser, setImpersonatedUser }}
|
||||
>
|
||||
{children}
|
||||
</ImpersonateUserContext.Provider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user