mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
🗂Better folder structure on frontend
This commit is contained in:
19
frontend/src/context/Auth/AuthContext.js
Normal file
19
frontend/src/context/Auth/AuthContext.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import React, { createContext } from "react";
|
||||
|
||||
import useAuth from "./useAuth";
|
||||
|
||||
const AuthContext = createContext();
|
||||
|
||||
const AuthProvider = ({ children }) => {
|
||||
const { isAuth, loading, handleLogin, handleLogout } = useAuth();
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
value={{ loading, isAuth, handleLogin, handleLogout }}
|
||||
>
|
||||
{children}
|
||||
</AuthContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export { AuthContext, AuthProvider };
|
||||
Reference in New Issue
Block a user