mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 05:07:10 +00:00
feat: authorization
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { useUserStore } from "@/shared/stores/user";
|
||||
import React from "react";
|
||||
import { Outlet } from "react-router";
|
||||
|
||||
export const AuthLayout = () => {
|
||||
const fetchUser = useUserStore((state) => state.fetchUser);
|
||||
|
||||
React.useEffect(() => {
|
||||
async function fetchData() {
|
||||
await fetchUser();
|
||||
}
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
return <Outlet />;
|
||||
};
|
||||
@@ -5,8 +5,10 @@ const NavbarLayout = () => {
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<div className="m-auto mt-6 w-full max-w-5xl">
|
||||
<Outlet />
|
||||
<div className="px-4 sm:px-6">
|
||||
<div className="m-auto mt-6 w-full max-w-5xl">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user