social components inlay.at
atproto components sdui
86
fork

Configure Feed

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

rm dead code

+2 -158
-9
app/at/[did]/[collection]/[rkey]/layout.tsx
··· 1 - import "@/app/sandbox/render/client"; 2 - 3 - export default function RecordLayout({ 4 - children, 5 - }: { 6 - children: React.ReactNode; 7 - }) { 8 - return <>{children}</>; 9 - }
-31
app/at/[did]/[collection]/[rkey]/page.tsx
··· 1 - import { redirect } from "next/navigation"; 2 - 3 - export default async function RecordPage({ 4 - params, 5 - searchParams, 6 - }: { 7 - params: Promise<{ did: string; collection: string; rkey: string }>; 8 - searchParams: Promise<Record<string, string | undefined>>; 9 - }) { 10 - const raw = await params; 11 - const sp = await searchParams; 12 - const paramDid = raw.did; 13 - const paramCollection = raw.collection; 14 - const paramRkey = raw.rkey; 15 - const layout = sp.layout as "page" | "full" | undefined; 16 - 17 - // Redirect to new route structure 18 - const qs = new URLSearchParams(); 19 - for (const [k, v] of Object.entries(sp)) { 20 - if (k !== "layout" && v) qs.set(k, v); 21 - } 22 - const qsSuffix = qs.toString() ? `?${qs.toString()}` : ""; 23 - 24 - if (layout === "full") { 25 - redirect(`/edit/at/${paramDid}/${paramCollection}/${paramRkey}${qsSuffix}`); 26 - } 27 - if (layout === "page") { 28 - redirect(`/list/at/${paramDid}/${paramCollection}/${paramRkey}${qsSuffix}`); 29 - } 30 - redirect(`/list/at/${paramDid}/${paramCollection}/${paramRkey}${qsSuffix}`); 31 - }
-52
app/at/[did]/[collection]/layout.tsx
··· 1 - import { BrowseShell } from "@/app/sandbox/browse/browse-shell"; 2 - import { 3 - listComponentsByCollection, 4 - listFamiliesForCollection, 5 - } from "@/data/queries"; 6 - import { resolveDidToHandle } from "@/data/resolve"; 7 - import { getCurrentDid } from "@/auth"; 8 - import type { BrowseComponentCard } from "@/app/sandbox/browse/browse"; 9 - 10 - export default async function CollectionLayout({ 11 - children, 12 - params, 13 - }: { 14 - children: React.ReactNode; 15 - params: Promise<{ did: string; collection: string }>; 16 - }) { 17 - const raw = await params; 18 - const collection = decodeURIComponent(raw.collection); 19 - 20 - const authDid = await getCurrentDid(); 21 - const [components, families] = await Promise.all([ 22 - listComponentsByCollection(collection, authDid), 23 - listFamiliesForCollection(collection), 24 - ]); 25 - 26 - const authorDids = [ 27 - ...new Set([ 28 - ...components.map((c) => c.authorDid), 29 - ...(authDid ? [authDid] : []), 30 - ]), 31 - ]; 32 - const handles = new Map<string, string>(); 33 - await Promise.all( 34 - authorDids.map(async (d) => { 35 - handles.set(d, await resolveDidToHandle(d)); 36 - }) 37 - ); 38 - 39 - const cards: BrowseComponentCard[] = components.map((c) => ({ 40 - uri: c.uri, 41 - nsid: c.nsid, 42 - authorDid: c.authorDid, 43 - authorHandle: handles.get(c.authorDid) ?? c.authorDid, 44 - record: c.record, 45 - })); 46 - 47 - return ( 48 - <BrowseShell families={families} cards={cards} authDid={authDid}> 49 - {children} 50 - </BrowseShell> 51 - ); 52 - }
-10
app/at/[did]/[collection]/page.tsx
··· 1 - import { redirect } from "next/navigation"; 2 - 3 - export default async function CollectionPage({ 4 - params, 5 - }: { 6 - params: Promise<{ did: string; collection: string }>; 7 - }) { 8 - const raw = await params; 9 - redirect(`/list/at/${raw.did}/${raw.collection}`); 10 - }
-3
app/at/[did]/page.tsx
··· 1 - export default function DidPage() { 2 - return null; 3 - }
-41
app/at/layout-switch.tsx
··· 1 - "use client"; 2 - 3 - import { useSearchParams } from "next/navigation"; 4 - import { NavProvider } from "./nav"; 5 - 6 - export function LayoutSwitch({ children }: { children: React.ReactNode }) { 7 - const searchParams = useSearchParams(); 8 - const layout = searchParams.get("layout"); 9 - 10 - if (layout === "full" || layout === "page") { 11 - return ( 12 - <div 13 - style={{ 14 - display: "flex", 15 - flexDirection: "column", 16 - height: "100vh", 17 - fontFamily: "'Rubik', -apple-system, sans-serif", 18 - background: "var(--bg-0)", 19 - }} 20 - > 21 - <div style={{ display: "flex", flex: 1, minHeight: 0 }}>{children}</div> 22 - </div> 23 - ); 24 - } 25 - 26 - return ( 27 - <div 28 - style={{ 29 - display: "flex", 30 - flexDirection: "column", 31 - height: "100vh", 32 - fontFamily: "'Rubik', -apple-system, sans-serif", 33 - background: "var(--bg-0)", 34 - }} 35 - > 36 - <NavProvider> 37 - <div style={{ display: "flex", flex: 1, minHeight: 0 }}>{children}</div> 38 - </NavProvider> 39 - </div> 40 - ); 41 - }
-10
app/at/layout.tsx
··· 1 - import { NavigationBlockerProvider } from "@/app/link"; 2 - import { LayoutSwitch } from "./layout-switch"; 3 - 4 - export default function AtLayout({ children }: { children: React.ReactNode }) { 5 - return ( 6 - <NavigationBlockerProvider> 7 - <LayoutSwitch>{children}</LayoutSwitch> 8 - </NavigationBlockerProvider> 9 - ); 10 - }
app/at/nav.tsx app/nav.tsx
+1 -1
app/list/at/layout.tsx
··· 1 1 import { Suspense } from "react"; 2 2 import { NavigationBlockerProvider } from "@/app/link"; 3 - import { NavProvider } from "@/app/at/nav"; 3 + import { NavProvider } from "../../nav"; 4 4 import { AuthChip } from "@/app/auth-chip"; 5 5 6 6 export default function ListLayout({
+1 -1
app/sandbox/browse/browse-shell.tsx
··· 3 3 import { useState, type ReactNode } from "react"; 4 4 import Link from "@/app/link"; 5 5 import { useSearchParams, usePathname } from "next/navigation"; 6 - import { useNav, useRecordParams } from "@/app/at/nav"; 6 + import { useNav, useRecordParams } from "../../nav"; 7 7 import { parseAtUri } from "@/data/uri"; 8 8 import type { FamilyInfo } from "@/data/queries"; 9 9 import type { BrowseComponentCard } from "./browse";