mirror of
https://github.com/MeshEnvy/mesh-forge.git
synced 2026-03-28 17:42:55 +01:00
28 lines
794 B
TypeScript
28 lines
794 B
TypeScript
import "./Layout.css";
|
|
import "./tailwind.css";
|
|
import logoUrl from "../assets/logo.png";
|
|
import { Link } from "../components/Link";
|
|
import { ConvexReactClient } from "convex/react";
|
|
import { ConvexAuthProvider } from "@convex-dev/auth/react";
|
|
import Navbar from "@/components/Navbar";
|
|
import { usePageContext } from "vike-react/usePageContext";
|
|
|
|
const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string);
|
|
|
|
function ConditionalNavbar() {
|
|
const pageContext = usePageContext();
|
|
if (pageContext.urlPathname === "/") {
|
|
return null;
|
|
}
|
|
return <Navbar />;
|
|
}
|
|
|
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<ConvexAuthProvider client={convex}>
|
|
<ConditionalNavbar />
|
|
{children}
|
|
</ConvexAuthProvider>
|
|
);
|
|
}
|