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:standardize buttons

+27 -55
+2 -6
web/src/components/BBSPanel.tsx
··· 1 1 import { Link } from "react-router-dom"; 2 + import { ActionLink } from "./nav/ActionButton"; 2 3 3 4 const cardStyle = 4 5 "bg-neutral-900 border border-neutral-800 rounded px-4 py-3 text-neutral-300 hover:text-neutral-200 hover:border-neutral-700"; ··· 16 17 <p className="text-neutral-500 mb-4"> 17 18 You haven't set up a BBS yet. 18 19 </p> 19 - <Link 20 - to="/account/create" 21 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded inline-block" 22 - > 23 - create a bbs 24 - </Link> 20 + <ActionLink to="/account/create">create a bbs</ActionLink> 25 21 </> 26 22 ); 27 23 }
+3 -13
web/src/components/DialBBS.tsx
··· 1 1 import { useEffect, useRef, useState, type SyntheticEvent } from "react"; 2 2 import { Link, useNavigate } from "react-router-dom"; 3 3 import HandleInput from "./form/HandleInput"; 4 + import { Button } from "./form/Form"; 4 5 import { resolveIdentity, getRecord } from "../lib/atproto"; 5 6 import { SITE } from "../lib/lexicon"; 6 7 import type { DiscoveredBBS } from "../hooks/useDiscovery"; ··· 108 109 required 109 110 className="sm:flex-1" 110 111 /> 111 - <button 112 - type="submit" 113 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded" 114 - > 115 - go 116 - </button> 117 - <button 118 - type="button" 119 - onClick={onRandom} 120 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded" 121 - > 122 - random 123 - </button> 112 + <Button type="submit">go</Button> 113 + <Button type="button" onClick={onRandom}>random</Button> 124 114 </form> 125 115 {focused && visibleSuggestions.length > 0 && ( 126 116 <div className="relative">
+3 -7
web/src/components/ErrorPage.tsx
··· 1 - import { Link, isRouteErrorResponse, useRouteError } from "react-router-dom"; 1 + import { isRouteErrorResponse, useRouteError } from "react-router-dom"; 2 2 import { BBSNotFoundError, NoBBSError, NetworkError } from "../lib/bbs"; 3 + import { ActionLink } from "./nav/ActionButton"; 3 4 4 5 export default function ErrorPage() { 5 6 const error = useRouteError(); ··· 28 29 <div className="py-16 text-center"> 29 30 <h1 className="text-lg text-neutral-200 mb-2">{title}</h1> 30 31 {detail && <p className="text-neutral-500 mb-6">{detail}</p>} 31 - <Link 32 - to="/" 33 - className="inline-block bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded" 34 - > 35 - ← back to home 36 - </Link> 32 + <ActionLink to="/">← back to home</ActionLink> 37 33 </div> 38 34 ); 39 35 }
+11 -5
web/src/components/nav/ActionButton.tsx
··· 1 1 import { Link } from "react-router-dom"; 2 2 3 3 const actionStyle = 4 - "bg-neutral-800 hover:bg-neutral-700 text-neutral-300 px-3 py-1 rounded text-xs"; 4 + "bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded"; 5 5 6 6 interface ActionButtonProps { 7 7 onClick: () => void; 8 8 children: React.ReactNode; 9 + className?: string; 9 10 } 10 11 11 12 interface ActionLinkProps { 12 13 to: string; 13 14 children: React.ReactNode; 15 + className?: string; 14 16 } 15 17 16 - export function ActionButton({ onClick, children }: ActionButtonProps) { 18 + export function ActionButton({ 19 + onClick, 20 + children, 21 + className, 22 + }: ActionButtonProps) { 17 23 return ( 18 - <button onClick={onClick} className={actionStyle}> 24 + <button onClick={onClick} className={`${actionStyle} ${className ?? ""}`}> 19 25 {children} 20 26 </button> 21 27 ); 22 28 } 23 29 24 - export function ActionLink({ to, children }: ActionLinkProps) { 30 + export function ActionLink({ to, children, className }: ActionLinkProps) { 25 31 return ( 26 - <Link to={to} className={actionStyle}> 32 + <Link to={to} className={`${actionStyle} ${className ?? ""}`}> 27 33 {children} 28 34 </Link> 29 35 );
+2 -6
web/src/components/profile/ViewProfile.tsx
··· 1 1 import { Link } from "react-router-dom"; 2 2 import PostBody from "../post/PostBody"; 3 + import { ActionButton } from "../nav/ActionButton"; 3 4 import type { Profile } from "../../lib/profile"; 4 5 5 6 interface ViewProfileProps { ··· 22 23 {profile?.name ?? handle} 23 24 </h1> 24 25 {isOwner && ( 25 - <button 26 - onClick={onEdit} 27 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded text-xs" 28 - > 29 - edit profile 30 - </button> 26 + <ActionButton onClick={onEdit}>edit profile</ActionButton> 31 27 )} 32 28 </div> 33 29 <p className="text-neutral-500">
+3 -6
web/src/pages/Login.tsx
··· 2 2 import { useAuth } from "../lib/auth"; 3 3 import { usePageTitle } from "../hooks/usePageTitle"; 4 4 import HandleInput from "../components/form/HandleInput"; 5 + import { Button } from "../components/form/Form"; 5 6 6 7 export default function Login() { 7 8 const { login } = useAuth(); ··· 37 38 required 38 39 className="flex-1" 39 40 /> 40 - <button 41 - type="submit" 42 - disabled={busy} 43 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-4 py-2 rounded" 44 - > 41 + <Button type="submit" disabled={busy}> 45 42 {busy ? "..." : "log in"} 46 - </button> 43 + </Button> 47 44 </form> 48 45 </> 49 46 );
+3 -12
web/src/pages/SysopModerate.tsx
··· 5 5 import { BAN, HIDE } from "../lib/lexicon"; 6 6 import { invalidateBBSCache } from "../lib/bbs"; 7 7 import HandleInput from "../components/form/HandleInput"; 8 + import { Button } from "../components/form/Form"; 8 9 import { usePageTitle } from "../hooks/usePageTitle"; 9 10 import { createBan, createHide, deleteRecord } from "../lib/writes"; 10 11 import type { BBS } from "../lib/bbs"; ··· 117 118 onChange={setIdentifier} 118 119 className="flex-1" 119 120 /> 120 - <button 121 - onClick={ban} 122 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-3 py-2 rounded text-xs" 123 - > 124 - ban 125 - </button> 121 + <Button onClick={ban}>ban</Button> 126 122 </div> 127 123 </div> 128 124 ··· 163 159 placeholder="at://did/collection/rkey" 164 160 className="flex-1 bg-neutral-900 border border-neutral-800 rounded px-3 py-2 text-neutral-200 placeholder-neutral-500 focus:outline-none focus:border-neutral-600" 165 161 /> 166 - <button 167 - onClick={hide} 168 - className="bg-neutral-800 hover:bg-neutral-700 text-neutral-200 px-3 py-2 rounded text-xs" 169 - > 170 - hide 171 - </button> 162 + <Button onClick={hide}>hide</Button> 172 163 </div> 173 164 </div> 174 165 </div>