Write on the margins of the internet. Powered by the AT Protocol.
0
fork

Configure Feed

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

refactor: rename /site to /url

+16 -39
+4 -27
web/src/App.tsx
··· 1 1 import React from "react"; 2 - import { 3 - BrowserRouter, 4 - Routes, 5 - Route, 6 - Navigate, 7 - useSearchParams, 8 - } from "react-router-dom"; 2 + import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom"; 9 3 import { initAuth } from "./store/auth"; 10 4 import { loadPreferences } from "./store/preferences"; 11 5 ··· 23 17 CollectionDetailWrapper, 24 18 AnnotationDetailWrapper, 25 19 UserUrlWrapper, 26 - SiteWrapper, 20 + UrlWrapper, 27 21 } from "./routes/wrappers"; 28 22 import About from "./views/About"; 29 23 import AdminModeration from "./views/core/AdminModeration"; 30 24 import NotFound from "./views/NotFound"; 31 - 32 - function UrlRedirect() { 33 - const [searchParams] = useSearchParams(); 34 - const q = searchParams.get("q"); 35 - if (q) { 36 - return <Navigate to={`/site/${encodeURIComponent(q)}`} replace />; 37 - } 38 - return <Navigate to="/site" replace />; 39 - } 40 25 41 26 export default function App() { 42 27 React.useEffect(() => { ··· 145 130 /> 146 131 147 132 <Route 148 - path="/url" 149 - element={ 150 - <AppLayout> 151 - <UrlRedirect /> 152 - </AppLayout> 153 - } 154 - /> 155 - <Route 156 133 path="/new" 157 134 element={ 158 135 <AppLayout> ··· 209 186 } 210 187 /> 211 188 <Route 212 - path="/site/*" 189 + path="/url/*" 213 190 element={ 214 191 <AppLayout> 215 - <SiteWrapper /> 192 + <UrlWrapper /> 216 193 </AppLayout> 217 194 } 218 195 />
+2 -2
web/src/components/navigation/MobileNav.tsx
··· 205 205 </Link> 206 206 207 207 <Link 208 - to="/site" 208 + to="/url" 209 209 className={`flex flex-col items-center justify-center w-14 h-14 rounded-xl transition-colors ${ 210 - isActive("/site") 210 + isActive("/url") 211 211 ? "text-primary-600" 212 212 : "text-surface-500 hover:text-surface-700" 213 213 }`}
+1 -1
web/src/components/navigation/RightSidebar.tsx
··· 18 18 19 19 const handleSearch = (e: React.KeyboardEvent) => { 20 20 if (e.key === "Enter" && searchQuery.trim()) { 21 - navigate(`/site/${encodeURIComponent(searchQuery.trim())}`); 21 + navigate(`/url/${encodeURIComponent(searchQuery.trim())}`); 22 22 } 23 23 }; 24 24
+6 -6
web/src/routes/wrappers.tsx
··· 1 + import { useStore } from "@nanostores/react"; 1 2 import React from "react"; 2 3 import { Navigate, useParams } from "react-router-dom"; 3 - import { useStore } from "@nanostores/react"; 4 4 import { $user } from "../store/auth"; 5 - import Profile from "../views/profile/Profile"; 6 5 import CollectionDetail from "../views/collections/CollectionDetail"; 7 6 import AnnotationDetail from "../views/content/AnnotationDetail"; 8 - import UserUrlPage from "../views/content/UserUrl"; 9 - import SitePage from "../views/content/SitePage"; 7 + import UrlPage from "../views/content/UrlPage"; 8 + import UserUrlPage from "../views/content/UserUrlPage"; 9 + import Profile from "../views/profile/Profile"; 10 10 11 11 export function ProfileWrapper() { 12 12 const { did } = useParams(); ··· 33 33 return <UserUrlPage />; 34 34 } 35 35 36 - export function SiteWrapper() { 37 - return <SitePage />; 36 + export function UrlWrapper() { 37 + return <UrlPage />; 38 38 }
+3 -3
web/src/views/content/SitePage.tsx web/src/views/content/UrlPage.tsx
··· 21 21 22 22 import { Tabs, EmptyState, Input, Button } from "../../components/ui"; 23 23 24 - export default function SitePage() { 24 + export default function UrlPage() { 25 25 const params = useParams(); 26 26 const navigate = useNavigate(); 27 27 const urlPath = params["*"]; ··· 120 120 /> 121 121 </div> 122 122 <h1 className="text-3xl font-display font-bold text-surface-900 dark:text-white mb-3"> 123 - Site Annotations 123 + URL Annotations 124 124 </h1> 125 125 <p className="text-surface-500 dark:text-surface-400 max-w-md mx-auto mb-8"> 126 126 Enter a URL to see all public annotations and highlights from the ··· 134 134 const q = (formData.get("q") as string)?.trim(); 135 135 if (q) { 136 136 const encoded = encodeURIComponent(q); 137 - navigate(`/site/${encoded}`); 137 + navigate(`/url/${encoded}`); 138 138 } 139 139 }} 140 140 className="max-w-md mx-auto flex gap-2"
web/src/views/content/UserUrl.tsx web/src/views/content/UserUrlPage.tsx