From 22a906e8d5e8acf7eb737ebf4b5d0cd4d3d223f5 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 22 Apr 2026 15:47:28 -0400 Subject: [PATCH] web: cleanup file hierarchy --- web/src/components/{ => auth}/AtprotoAppsCard.tsx | 2 +- web/src/components/{ => auth}/LoginModal.tsx | 6 +++--- web/src/components/{ => dashboard}/ActivityList.tsx | 8 ++++---- web/src/components/{ => dashboard}/BBSPanel.tsx | 4 ++-- web/src/components/{ => dashboard}/DialBBS.tsx | 12 ++++++------ web/src/components/{ => dashboard}/DiscoveryList.tsx | 4 ++-- web/src/components/{ => dashboard}/MyThreadList.tsx | 4 ++-- web/src/components/{ => dashboard}/PinnedList.tsx | 4 ++-- web/src/components/{ => layout}/ErrorPage.tsx | 6 +++--- web/src/components/layout/Layout.tsx | 2 +- web/src/hooks/useResolvedBBS.ts | 2 +- web/src/pages/Dashboard.tsx | 10 +++++----- web/src/pages/LoggedOutHome.tsx | 4 ++-- web/src/pages/Profile.tsx | 2 +- web/src/router/routes.tsx | 2 +- 15 files changed, 36 insertions(+), 36 deletions(-) rename web/src/components/{ => auth}/AtprotoAppsCard.tsx (94%) rename web/src/components/{ => auth}/LoginModal.tsx (92%) rename web/src/components/{ => dashboard}/ActivityList.tsx (90%) rename web/src/components/{ => dashboard}/BBSPanel.tsx (97%) rename web/src/components/{ => dashboard}/DialBBS.tsx (93%) rename web/src/components/{ => dashboard}/DiscoveryList.tsx (86%) rename web/src/components/{ => dashboard}/MyThreadList.tsx (93%) rename web/src/components/{ => dashboard}/PinnedList.tsx (91%) rename web/src/components/{ => layout}/ErrorPage.tsx (90%) diff --git a/web/src/components/AtprotoAppsCard.tsx b/web/src/components/auth/AtprotoAppsCard.tsx similarity index 94% rename from web/src/components/AtprotoAppsCard.tsx rename to web/src/components/auth/AtprotoAppsCard.tsx index 840c3cd..a5e8db2 100644 --- a/web/src/components/AtprotoAppsCard.tsx +++ b/web/src/components/auth/AtprotoAppsCard.tsx @@ -1,5 +1,5 @@ import { ExternalLink } from "lucide-react"; -import type { AtprotoApp } from "../lib/atprotoApps"; +import type { AtprotoApp } from "../../lib/atprotoApps"; interface AtprotoAppsCardProps { apps: AtprotoApp[]; diff --git a/web/src/components/LoginModal.tsx b/web/src/components/auth/LoginModal.tsx similarity index 92% rename from web/src/components/LoginModal.tsx rename to web/src/components/auth/LoginModal.tsx index 8b97c2f..9a8d9fd 100644 --- a/web/src/components/LoginModal.tsx +++ b/web/src/components/auth/LoginModal.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from "react"; import { X } from "lucide-react"; -import { useLoginModal } from "../lib/loginModal"; -import { pickRandomApps } from "../lib/atprotoApps"; -import LoginForm from "./form/LoginForm"; +import { useLoginModal } from "../../lib/loginModal"; +import { pickRandomApps } from "../../lib/atprotoApps"; +import LoginForm from "../form/LoginForm"; import AtprotoAppsCard from "./AtprotoAppsCard"; export default function LoginModal() { diff --git a/web/src/components/ActivityList.tsx b/web/src/components/dashboard/ActivityList.tsx similarity index 90% rename from web/src/components/ActivityList.tsx rename to web/src/components/dashboard/ActivityList.tsx index 0f7ebb9..8b8a2c8 100644 --- a/web/src/components/ActivityList.tsx +++ b/web/src/components/dashboard/ActivityList.tsx @@ -1,10 +1,10 @@ import { useState } from "react"; import { ChevronDown } from "lucide-react"; import { Link } from "react-router-dom"; -import { parseAtUri } from "../lib/util"; -import PostBody from "./post/PostBody"; -import PostMeta from "./post/PostMeta"; -import type { ActivityItem } from "../lib/activity"; +import { parseAtUri } from "../../lib/util"; +import PostBody from "../post/PostBody"; +import PostMeta from "../post/PostMeta"; +import type { ActivityItem } from "../../lib/activity"; const PAGE_SIZE = 10; diff --git a/web/src/components/BBSPanel.tsx b/web/src/components/dashboard/BBSPanel.tsx similarity index 97% rename from web/src/components/BBSPanel.tsx rename to web/src/components/dashboard/BBSPanel.tsx index 5c46e5e..39cca84 100644 --- a/web/src/components/BBSPanel.tsx +++ b/web/src/components/dashboard/BBSPanel.tsx @@ -2,8 +2,8 @@ import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import type { LucideIcon } from "lucide-react"; import { ArrowRight, Pencil, Plus, Shield, Trash2 } from "lucide-react"; -import { ActionLink } from "./nav/ActionButton"; -import { getAvatar } from "../lib/atproto"; +import { ActionLink } from "../nav/ActionButton"; +import { getAvatar } from "../../lib/atproto"; interface BBSPanelProps { hasBBS: boolean; diff --git a/web/src/components/DialBBS.tsx b/web/src/components/dashboard/DialBBS.tsx similarity index 93% rename from web/src/components/DialBBS.tsx rename to web/src/components/dashboard/DialBBS.tsx index 6cd0f7c..a34a1eb 100644 --- a/web/src/components/DialBBS.tsx +++ b/web/src/components/dashboard/DialBBS.tsx @@ -1,12 +1,12 @@ import { useState, type SyntheticEvent } from "react"; import { ArrowRight, Dices } from "lucide-react"; import { Link, useNavigate } from "react-router-dom"; -import HandleInput from "./form/HandleInput"; -import IdentityRow from "./IdentityRow"; -import { Button } from "./form/Form"; -import { useDropdown } from "../hooks/useDropdown"; -import { useResolvedBBS } from "../hooks/useResolvedBBS"; -import type { DiscoveredBBS } from "../hooks/useDiscovery"; +import HandleInput from "../form/HandleInput"; +import IdentityRow from "../IdentityRow"; +import { Button } from "../form/Form"; +import { useDropdown } from "../../hooks/useDropdown"; +import { useResolvedBBS } from "../../hooks/useResolvedBBS"; +import type { DiscoveredBBS } from "../../hooks/useDiscovery"; export interface Suggestion { to: string; diff --git a/web/src/components/DiscoveryList.tsx b/web/src/components/dashboard/DiscoveryList.tsx similarity index 86% rename from web/src/components/DiscoveryList.tsx rename to web/src/components/dashboard/DiscoveryList.tsx index 9abe6b2..f54bb43 100644 --- a/web/src/components/DiscoveryList.tsx +++ b/web/src/components/dashboard/DiscoveryList.tsx @@ -1,5 +1,5 @@ -import ListLink from "./nav/ListLink"; -import type { DiscoveredBBS } from "../hooks/useDiscovery"; +import ListLink from "../nav/ListLink"; +import type { DiscoveredBBS } from "../../hooks/useDiscovery"; interface DiscoveryListProps { discovered: DiscoveredBBS[]; diff --git a/web/src/components/MyThreadList.tsx b/web/src/components/dashboard/MyThreadList.tsx similarity index 93% rename from web/src/components/MyThreadList.tsx rename to web/src/components/dashboard/MyThreadList.tsx index c25fb05..c20820f 100644 --- a/web/src/components/MyThreadList.tsx +++ b/web/src/components/dashboard/MyThreadList.tsx @@ -1,8 +1,8 @@ import { useState } from "react"; import { ChevronDown } from "lucide-react"; import { Link } from "react-router-dom"; -import { parseAtUri, formatFullDate, relativeDate } from "../lib/util"; -import type { MyThread } from "../router/loaders"; +import { parseAtUri, formatFullDate, relativeDate } from "../../lib/util"; +import type { MyThread } from "../../router/loaders"; const PAGE_SIZE = 10; diff --git a/web/src/components/PinnedList.tsx b/web/src/components/dashboard/PinnedList.tsx similarity index 91% rename from web/src/components/PinnedList.tsx rename to web/src/components/dashboard/PinnedList.tsx index 0a000de..f7466fa 100644 --- a/web/src/components/PinnedList.tsx +++ b/web/src/components/dashboard/PinnedList.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { ChevronDown } from "lucide-react"; -import ListLink from "./nav/ListLink"; -import type { PinnedBBS } from "../router/loaders"; +import ListLink from "../nav/ListLink"; +import type { PinnedBBS } from "../../router/loaders"; const PAGE_SIZE = 5; diff --git a/web/src/components/ErrorPage.tsx b/web/src/components/layout/ErrorPage.tsx similarity index 90% rename from web/src/components/ErrorPage.tsx rename to web/src/components/layout/ErrorPage.tsx index e0e7b04..f35a77f 100644 --- a/web/src/components/ErrorPage.tsx +++ b/web/src/components/layout/ErrorPage.tsx @@ -1,7 +1,7 @@ import { isRouteErrorResponse, useRouteError } from "react-router-dom"; -import { BBSNotFoundError, NoBBSError, NetworkError } from "../lib/bbs"; -import { useAuth } from "../lib/auth"; -import { ActionLink } from "./nav/ActionButton"; +import { BBSNotFoundError, NoBBSError, NetworkError } from "../../lib/bbs"; +import { useAuth } from "../../lib/auth"; +import { ActionLink } from "../nav/ActionButton"; export default function ErrorPage() { const error = useRouteError(); diff --git a/web/src/components/layout/Layout.tsx b/web/src/components/layout/Layout.tsx index 1953e01..ded007b 100644 --- a/web/src/components/layout/Layout.tsx +++ b/web/src/components/layout/Layout.tsx @@ -2,7 +2,7 @@ import { Outlet, useNavigation } from "react-router-dom"; import Header from "./Header"; import MobileBackButton from "./MobileBackButton"; import Footer from "./Footer"; -import LoginModal from "../LoginModal"; +import LoginModal from "../auth/LoginModal"; import { LoginModalProvider } from "../../lib/loginModal"; import { useRevalidateOnFocus } from "../../hooks/useRevalidateOnFocus"; diff --git a/web/src/hooks/useResolvedBBS.ts b/web/src/hooks/useResolvedBBS.ts index b806c67..cbbf95c 100644 --- a/web/src/hooks/useResolvedBBS.ts +++ b/web/src/hooks/useResolvedBBS.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from "react"; import { resolveIdentity, getRecord, getAvatar } from "../lib/atproto"; import { SITE } from "../lib/lexicon"; -import type { Suggestion } from "../components/DialBBS"; +import type { Suggestion } from "../components/dashboard/DialBBS"; const DEBOUNCE_MS = 300; diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index e642bed..415d4e9 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -7,11 +7,11 @@ import { usePageTitle } from "../hooks/usePageTitle"; import DialBBS, { bbsToSuggestion, type Suggestion, -} from "../components/DialBBS"; -import PinnedList from "../components/PinnedList"; -import MyThreadList from "../components/MyThreadList"; -import ActivityList from "../components/ActivityList"; -import BBSPanel from "../components/BBSPanel"; +} from "../components/dashboard/DialBBS"; +import PinnedList from "../components/dashboard/PinnedList"; +import MyThreadList from "../components/dashboard/MyThreadList"; +import ActivityList from "../components/dashboard/ActivityList"; +import BBSPanel from "../components/dashboard/BBSPanel"; import type { ActivityItem, PinnedBBS, MyThread } from "../router/loaders"; import type { AuthUser } from "../lib/auth"; diff --git a/web/src/pages/LoggedOutHome.tsx b/web/src/pages/LoggedOutHome.tsx index 6445699..6210305 100644 --- a/web/src/pages/LoggedOutHome.tsx +++ b/web/src/pages/LoggedOutHome.tsx @@ -5,8 +5,8 @@ import { usePageTitle } from "../hooks/usePageTitle"; import DialBBS, { bbsToSuggestion, type Suggestion, -} from "../components/DialBBS"; -import DiscoveryList from "../components/DiscoveryList"; +} from "../components/dashboard/DialBBS"; +import DiscoveryList from "../components/dashboard/DiscoveryList"; export default function LoggedOutHome() { const discovered = useDiscovery(); diff --git a/web/src/pages/Profile.tsx b/web/src/pages/Profile.tsx index 64cb476..63e7090 100644 --- a/web/src/pages/Profile.tsx +++ b/web/src/pages/Profile.tsx @@ -6,7 +6,7 @@ import { usePageTitle } from "../hooks/usePageTitle"; import { putProfile } from "../lib/writes"; import ViewProfile from "../components/profile/ViewProfile"; import EditProfile from "../components/profile/EditProfile"; -import MyThreadList from "../components/MyThreadList"; +import MyThreadList from "../components/dashboard/MyThreadList"; import type { MyThread } from "../lib/mythreads"; import type { ProfileLoaderData } from "../router/loaders/profile"; diff --git a/web/src/router/routes.tsx b/web/src/router/routes.tsx index c40ac5b..eba5d80 100644 --- a/web/src/router/routes.tsx +++ b/web/src/router/routes.tsx @@ -6,7 +6,7 @@ import { } from "react-router-dom"; import Layout from "../components/layout/Layout"; -import ErrorPage from "../components/ErrorPage"; +import ErrorPage from "../components/layout/ErrorPage"; import HydrateFallback from "../components/layout/HydrateFallback"; import Home from "../pages/Home"; -- 2.51.2