Retro Bulletin Board Systems on atproto. Web app and TUI. lazy mirror of alyraffauf/atbbs atbbs.xyz
forums python tui atproto bbs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

web: show login prompt if account isn't running a bbs

+10 -2
+10 -2
web/src/components/ErrorPage.tsx
··· 1 1 import { isRouteErrorResponse, useRouteError } from "react-router-dom"; 2 2 import { BBSNotFoundError, NoBBSError, NetworkError } from "../lib/bbs"; 3 + import { useAuth } from "../lib/auth"; 3 4 import { ActionLink } from "./nav/ActionButton"; 4 5 5 6 export default function ErrorPage() { 6 7 const error = useRouteError(); 8 + const { user } = useAuth(); 7 9 8 10 let title = "Something went wrong."; 9 11 let detail: string | null = null; 12 + let action: { to: string; label: string } = { to: "/", label: "← back to home" }; 10 13 11 14 if (error instanceof BBSNotFoundError) { 12 15 title = "BBS not found."; 13 16 detail = "Couldn't resolve that handle. Double-check the spelling."; 14 17 } else if (error instanceof NoBBSError) { 15 18 title = "No BBS here."; 16 - detail = "This account isn't running a BBS yet."; 19 + if (user) { 20 + detail = "This account isn't running a BBS yet."; 21 + } else { 22 + detail = "This account isn't running a BBS yet. Is this you? Log in to start one."; 23 + action = { to: "/login", label: "log in" }; 24 + } 17 25 } else if (error instanceof NetworkError) { 18 26 title = "Couldn't reach the network."; 19 27 detail = "Try again in a moment."; ··· 29 37 <div className="py-16 text-center"> 30 38 <h1 className="text-lg text-neutral-200 mb-2">{title}</h1> 31 39 {detail && <p className="text-neutral-400 mb-6">{detail}</p>} 32 - <ActionLink to="/">← back to home</ActionLink> 40 + <ActionLink to={action.to}>{action.label}</ActionLink> 33 41 </div> 34 42 ); 35 43 }