Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 1 | import { isRouteErrorResponse, Links, Meta, Outlet, useRouteLoaderData } from "react-router"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 2 | |
| 3 | import type { Route } from "./+types/root"; | |
| 4 | import "./app.css"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 5 | import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url"; |
| 6 | import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url"; | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 7 | import { MobileBar, Sidebar } from "./components/shell"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 8 | import { ButtonLink } from "./components/ui"; |
| 9 | import { requireStaff } from "./lib/staff"; | |
| 10 | ||
| 11 | export const links: Route.LinksFunction = () => [ | |
| 12 | { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }, | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 13 | // The faces are served by sudo itself (@g1t/theme); these two are on every page. |
| 14 | { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| 15 | { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| Billing accounts, terms and enterprises; g1t is no longer free | 16 | ]; |
| 17 | ||
| 18 | export const meta: Route.MetaFunction = () => [ | |
| 19 | { title: "sudo · g1t" }, | |
| 20 | { name: "robots", content: "noindex, nofollow" }, | |
| 21 | ]; | |
| 22 | ||
| 23 | export async function loader({ context }: Route.LoaderArgs) { | |
| 24 | return { email: requireStaff(context).email }; | |
| 25 | } | |
| 26 | ||
| 27 | export function Layout({ children }: { children: React.ReactNode }) { | |
| 28 | const root = useRouteLoaderData<typeof loader>("root"); | |
| 29 | return ( | |
| 30 | <html lang="en"> | |
| 31 | <head> | |
| 32 | <meta charSet="utf-8" /> | |
| 33 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| 34 | <meta name="theme-color" content="#0f0f11" /> | |
| 35 | <Meta /> | |
| 36 | <Links /> | |
| 37 | </head> | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 38 | <body className="min-h-screen"> |
| 39 | <Sidebar email={root?.email} /> | |
| 40 | <MobileBar email={root?.email} /> | |
| 41 | <div className="lg:pl-60">{children}</div> | |
| Billing accounts, terms and enterprises; g1t is no longer free | 42 | {/* No <Scripts />: sudo ships no JavaScript, and its policy allows none. */} |
| 43 | </body> | |
| 44 | </html> | |
| 45 | ); | |
| 46 | } | |
| 47 | ||
| 48 | export default function App() { | |
| 49 | return <Outlet />; | |
| 50 | } | |
| 51 | ||
| 52 | export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { | |
| 53 | let title = "Something went wrong"; | |
| 54 | let details = "An unexpected error occurred."; | |
| 55 | if (isRouteErrorResponse(error)) { | |
| 56 | title = error.status === 404 ? "Not found" : `Error ${error.status}`; | |
| 57 | details = typeof error.data === "string" && error.data ? error.data : error.statusText || details; | |
| 58 | } else if (error instanceof Error) { | |
| 59 | // Staff only: the real reason helps more than a polite one. | |
| 60 | details = error.message; | |
| 61 | } | |
| 62 | return ( | |
| 63 | <main className="mx-auto max-w-xl px-4 py-24 text-center"> | |
| 64 | <h1 className="text-2xl font-semibold tracking-tight">{title}</h1> | |
| 65 | <p className="mt-3 break-words text-muted">{details}</p> | |
| 66 | <div className="mt-8"> | |
| 67 | <ButtonLink to="/" variant="quiet"> | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 68 | Back to the overview |
| Billing accounts, terms and enterprises; g1t is no longer free | 69 | </ButtonLink> |
| 70 | </div> | |
| 71 | </main> | |
| 72 | ); | |
| 73 | } |