2024-04-01 21:34:52 +03:00
|
|
|
import { Link, Outlet } from "react-router-dom";
|
|
|
|
|
import { Toaster } from "@/components/ui/toaster";
|
|
|
|
|
import { SideNav } from "./SideNav";
|
|
|
|
|
import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons";
|
2024-04-07 21:52:59 +03:00
|
|
|
import { Logo } from "@/components/Logo";
|
2024-04-15 11:54:12 -07:00
|
|
|
import { Profile } from "./Profile";
|
|
|
|
|
import { useContext } from "react";
|
|
|
|
|
import { UserContext } from "@/store/UserContext";
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
onLogout?: () => void;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function RootLayout({ onLogout }: Props) {
|
|
|
|
|
const user = useContext(UserContext);
|
2024-04-01 21:34:52 +03:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2024-04-07 21:52:59 +03:00
|
|
|
<div className="w-full h-full px-4">
|
2024-04-23 12:21:45 -07:00
|
|
|
<aside className="fixed w-72 px-6 shrink-0 min-h-screen border-r-2">
|
2024-04-01 21:34:52 +03:00
|
|
|
<Link
|
|
|
|
|
to="https://skyvern.com"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
2024-04-07 21:52:59 +03:00
|
|
|
<div className="h-24">
|
|
|
|
|
<Logo />
|
2024-04-01 21:34:52 +03:00
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
<SideNav />
|
2024-04-15 11:54:12 -07:00
|
|
|
{user ? (
|
|
|
|
|
<div className="absolute bottom-2 left-0 w-72 px-6 shrink-0">
|
|
|
|
|
<Profile name={user.name} onLogout={onLogout} />
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
2024-04-01 21:34:52 +03:00
|
|
|
</aside>
|
|
|
|
|
<div className="pl-72 h-24 flex justify-end items-center px-6 gap-4">
|
|
|
|
|
<Link
|
|
|
|
|
to="https://discord.com/invite/fG2XXEuQX3"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
2024-04-07 21:52:59 +03:00
|
|
|
<DiscordLogoIcon className="w-6 h-6" />
|
2024-04-01 21:34:52 +03:00
|
|
|
</Link>
|
|
|
|
|
<Link
|
|
|
|
|
to="https://github.com/Skyvern-AI/skyvern"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
2024-04-07 21:52:59 +03:00
|
|
|
<GitHubLogoIcon className="w-6 h-6" />
|
2024-04-01 21:34:52 +03:00
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
<main className="pl-72">
|
|
|
|
|
<Outlet />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
<Toaster />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { RootLayout };
|