From 8f929115ae671ab17a367fdd05e3b352efa5d1df Mon Sep 17 00:00:00 2001 From: Juliet Date: Sat, 9 May 2026 20:17:24 +0200 Subject: [PATCH] resize backlinks table cells --- src/components/backlinks.tsx | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/backlinks.tsx b/src/components/backlinks.tsx index a7052a1..72cde4c 100644 --- a/src/components/backlinks.tsx +++ b/src/components/backlinks.tsx @@ -2,6 +2,7 @@ import * as TID from "@atcute/tid"; import { A, useLocation } from "@solidjs/router"; import { createResource, createSignal, For, onMount, Show } from "solid-js"; import { getAllBacklinks, getRecordBacklinks, LinksWithRecords } from "../lib/api.js"; +import { useRepo } from "../lib/repo-context.jsx"; import { localDateFromTimestamp } from "../utils/date.js"; import { Button } from "./button.jsx"; import { Favicon } from "./favicon.jsx"; @@ -12,6 +13,7 @@ type BacklinksProps = { target: string; collection: string; path: string; + repoDid: string; }; type BacklinkEntry = { @@ -73,9 +75,12 @@ const BacklinkRecords = (props: BacklinksProps & { cursor?: string }) => { Loading…

}> {({ did, collection, rkey }) => { - const timestamp = - TID.validate(rkey) ? localDateFromTimestamp(TID.parse(rkey).timestamp / 1000) : null; const uri = `at://${did}/${collection}/${rkey}`; + const rkeyIsRepo = rkey === props.repoDid; + const timestamp = + !rkeyIsRepo && TID.validate(rkey) ? + localDateFromTimestamp(TID.parse(rkey).timestamp / 1000) + : null; return ( { trigger={ - {rkey} + + {rkey} + e.stopPropagation()} > {did} } /> - - {timestamp ?? ""} - + + + {timestamp ?? ""} + + } /> @@ -126,6 +137,7 @@ const BacklinkRecords = (props: BacklinksProps & { cursor?: string }) => { target={props.target} collection={props.collection} path={props.path} + repoDid={props.repoDid} cursor={links()!.cursor} />
@@ -171,6 +183,7 @@ const BacklinkCollectionDetail = (props: { collection: string; entries: BacklinkEntry[]; pathname: string; + repoDid: string; }) => { const authority = () => props.collection.split(".").slice(0, 2).join("."); @@ -205,6 +218,7 @@ const BacklinkCollectionDetail = (props: { target={props.target} collection={entry.collection} path={entry.path} + repoDid={props.repoDid} /> @@ -215,6 +229,7 @@ const BacklinkCollectionDetail = (props: { }; const Backlinks = (props: { target: string }) => { + const repo = useRepo(); const location = useLocation(); const [response] = createResource(async () => { @@ -251,6 +266,7 @@ const Backlinks = (props: { target: string }) => { collection={selectedCollection()!} entries={selectedEntries()} pathname={location.pathname} + repoDid={repo.did()} /> -- 2.51.2