Skip to content
12 linesCodeBlameRaw

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.

Not found and error pages have one main landmark: their own when signed out, the shell's when signed in1import { type ComponentProps, createContext, useContext } from "react";
2
3/** True inside the app shell, whose `<main id="content">` already holds the page. */
4export const InMain = createContext(false);
5
6/**
7 * A page's main landmark: `<main>` where nothing above is one (signed out),
8 * a plain `<div>` inside the shell, so a page never has two.
9 */
10export function PageMain(props: ComponentProps<"main">) {
11 return useContext(InMain) ? <div {...props} /> : <main {...props} />;
12}