diff --git a/src/components/lexicon-schema.tsx b/src/components/lexicon-schema.tsx index b9638a1..d3c5959 100644 --- a/src/components/lexicon-schema.tsx +++ b/src/components/lexicon-schema.tsx @@ -1,7 +1,9 @@ import { Nsid } from "@atcute/lexicons"; -import { useLocation, useNavigate } from "@solidjs/router"; +import { AtprotoDid } from "@atcute/lexicons/syntax"; +import { A, useLocation, useNavigate } from "@solidjs/router"; import { createEffect, For, Show } from "solid-js"; import { resolveLexiconAuthority } from "../utils/api.js"; +import Tooltip from "./tooltip.jsx"; // Style constants const CONTAINER_CLASS = @@ -689,7 +691,7 @@ const DefSection = (props: { name: string; def: LexiconDef }) => { ); }; -export const LexiconSchemaView = (props: { schema: LexiconSchema }) => { +export const LexiconSchemaView = (props: { schema: LexiconSchema; authority?: AtprotoDid }) => { const location = useLocation(); // Handle scrolling to a definition when hash is like #schema:definitionName @@ -708,7 +710,20 @@ export const LexiconSchemaView = (props: { schema: LexiconSchema }) => {
{/* Header */}
-

{props.schema.id}

+
+

{props.schema.id}

+ + + + + + + +
Lexicon version: diff --git a/src/views/record.tsx b/src/views/record.tsx index 20ce753..dfaa7c2 100644 --- a/src/views/record.tsx +++ b/src/views/record.tsx @@ -195,7 +195,7 @@ export const RecordView = () => { const [externalLink, setExternalLink] = createSignal< { label: string; link: string; icon?: string } | undefined >(); - const [lexiconUri, setLexiconUri] = createSignal(); + const [lexiconAuthority, setLexiconAuthority] = createSignal(); const [validRecord, setValidRecord] = createSignal(undefined); const [validSchema, setValidSchema] = createSignal(undefined); const [schema, setSchema] = createSignal(); @@ -207,7 +207,6 @@ export const RecordView = () => { const fetchRecord = async () => { setValidRecord(undefined); setValidSchema(undefined); - setLexiconUri(undefined); const pds = await resolvePDS(did!); rpc = new Client({ handler: simpleFetchHandler({ service: pds }) }); const res = await rpc.get("com.atproto.repo.getRecord", { @@ -309,7 +308,7 @@ export const RecordView = () => { const resolveLexicon = async (nsid: Nsid) => { try { const authority = await resolveLexiconAuthority(nsid); - setLexiconUri(`at://${authority}/com.atproto.lexicon.schema/${nsid}`); + setLexiconAuthority(authority); if (params.collection !== "com.atproto.lexicon.schema") { const schema = await resolveLexiconSchema(authority, nsid); setSchema(schema); @@ -487,7 +486,10 @@ export const RecordView = () => {
Error: {err.message}
}> - +
@@ -565,19 +567,6 @@ export const RecordView = () => {
- -
-

Lexicon schema

- -
-