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";
|
2024-07-24 05:22:16 -07:00
|
|
|
import {
|
|
|
|
|
DiscordLogoIcon,
|
|
|
|
|
PinLeftIcon,
|
|
|
|
|
PinRightIcon,
|
|
|
|
|
} from "@radix-ui/react-icons";
|
2024-04-07 21:52:59 +03:00
|
|
|
import { Logo } from "@/components/Logo";
|
2024-07-10 23:21:30 +03:00
|
|
|
import GitHubButton from "react-github-btn";
|
2024-07-24 05:22:16 -07:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import { cn } from "@/util/utils";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { LogoMinimized } from "@/components/LogoMinimized";
|
2024-04-15 11:54:12 -07:00
|
|
|
|
2024-05-07 11:31:05 -07:00
|
|
|
function RootLayout() {
|
2024-07-24 05:22:16 -07:00
|
|
|
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
2024-04-01 21:34:52 +03:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2024-07-24 05:22:16 -07:00
|
|
|
<div className="h-full w-full">
|
|
|
|
|
<aside
|
|
|
|
|
className={cn("fixed h-screen min-h-screen border-r-2 px-6", {
|
|
|
|
|
"w-64": !sidebarCollapsed,
|
|
|
|
|
"w-28": sidebarCollapsed,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex h-full flex-col">
|
|
|
|
|
<Link to={window.location.origin}>
|
|
|
|
|
<div className="flex h-24 items-center">
|
|
|
|
|
{sidebarCollapsed ? <LogoMinimized /> : <Logo />}
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
<SideNav collapsed={sidebarCollapsed} />
|
|
|
|
|
<div
|
|
|
|
|
className={cn("mt-auto flex min-h-16", {
|
|
|
|
|
"justify-center": sidebarCollapsed,
|
|
|
|
|
"justify-end": !sidebarCollapsed,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
size="icon"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setSidebarCollapsed(!sidebarCollapsed);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{sidebarCollapsed ? (
|
|
|
|
|
<PinRightIcon className="h-6 w-6" />
|
|
|
|
|
) : (
|
|
|
|
|
<PinLeftIcon className="h-6 w-6" />
|
|
|
|
|
)}
|
|
|
|
|
</Button>
|
2024-04-15 11:54:12 -07:00
|
|
|
</div>
|
2024-07-24 05:22:16 -07:00
|
|
|
</div>
|
2024-04-01 21:34:52 +03:00
|
|
|
</aside>
|
2024-07-24 05:22:16 -07:00
|
|
|
<div className="flex h-24 items-center justify-end gap-4 px-6">
|
2024-04-01 21:34:52 +03:00
|
|
|
<Link
|
|
|
|
|
to="https://discord.com/invite/fG2XXEuQX3"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
2024-07-11 21:29:47 +03:00
|
|
|
<DiscordLogoIcon className="h-7 w-7" />
|
2024-04-01 21:34:52 +03:00
|
|
|
</Link>
|
2024-07-10 23:53:57 +03:00
|
|
|
<div className="h-7">
|
|
|
|
|
<GitHubButton
|
|
|
|
|
href="https://github.com/skyvern-ai/skyvern"
|
|
|
|
|
data-color-scheme="no-preference: dark; light: dark; dark: dark;"
|
|
|
|
|
data-size="large"
|
|
|
|
|
data-show-count="true"
|
|
|
|
|
aria-label="Star skyvern-ai/skyvern on GitHub"
|
|
|
|
|
>
|
|
|
|
|
Star
|
|
|
|
|
</GitHubButton>
|
|
|
|
|
</div>
|
2024-04-01 21:34:52 +03:00
|
|
|
</div>
|
2024-07-24 05:22:16 -07:00
|
|
|
<main
|
|
|
|
|
className={cn("pb-4 pl-64", {
|
|
|
|
|
"pl-28": sidebarCollapsed,
|
|
|
|
|
})}
|
|
|
|
|
>
|
2024-04-01 21:34:52 +03:00
|
|
|
<Outlet />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
<Toaster />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { RootLayout };
|