feat: authorization

This commit is contained in:
moolcoov
2025-03-01 20:24:23 +03:00
parent f74b8df791
commit 535b0c39dc
22 changed files with 560 additions and 108 deletions
@@ -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>
</>
);