Files
Dorod-Sky/skyvern-frontend/src/routes/root/RootLayout.tsx

60 lines
1.8 KiB
TypeScript
Raw Normal View History

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-10 23:21:30 +03:00
import { DiscordLogoIcon } from "@radix-ui/react-icons";
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";
2024-07-10 23:21:30 +03:00
import GitHubButton from "react-github-btn";
2024-04-15 11:54:12 -07:00
2024-05-07 11:31:05 -07:00
function RootLayout() {
2024-04-15 11:54:12 -07:00
const user = useContext(UserContext);
2024-04-01 21:34:52 +03:00
return (
<>
<div className="h-full w-full px-4">
<aside className="fixed min-h-screen w-72 shrink-0 border-r-2 px-6">
<Link to={window.location.origin}>
<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 shrink-0 px-6">
2024-05-07 11:31:05 -07:00
<Profile name={user.name} />
2024-04-15 11:54:12 -07:00
</div>
) : null}
2024-04-01 21:34:52 +03:00
</aside>
<div className="flex h-24 items-center justify-end gap-4 px-6 pl-72">
2024-04-01 21:34:52 +03:00
<Link
to="https://discord.com/invite/fG2XXEuQX3"
target="_blank"
rel="noopener noreferrer"
>
<DiscordLogoIcon className="h-7 w-7" />
2024-04-01 21:34:52 +03:00
</Link>
<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>
<main className="pb-4 pl-72">
2024-04-01 21:34:52 +03:00
<Outlet />
</main>
</div>
<Toaster />
</>
);
}
export { RootLayout };