move copy CID to record submenu

juli.ee 1f59b295 c781ace4

verified
Changed files
+4 -7
src
components
views
-4
src/components/navbar.tsx
··· 5 5 import Tooltip from "./tooltip"; 6 6 7 7 export const [pds, setPDS] = createSignal<string>(); 8 - export const [cid, setCID] = createSignal<string>(); 9 8 export const [isLabeler, setIsLabeler] = createSignal(false); 10 9 11 10 const NavBar = (props: { params: Params }) => { ··· 60 59 copyContent={`at://${props.params.repo}${props.params.collection ? `/${props.params.collection}` : ""}${props.params.rkey ? `/${props.params.rkey}` : ""}`} 61 60 label="Copy AT URI" 62 61 /> 63 - </Show> 64 - <Show when={props.params.rkey && cid()}> 65 - <CopyMenu copyContent={cid()!} label="Copy CID" /> 66 62 </Show> 67 63 </DropdownMenu> 68 64 </MenuProvider>
+4 -3
src/views/record.tsx
··· 10 10 import { JSONValue } from "../components/json.jsx"; 11 11 import { agent } from "../components/login.jsx"; 12 12 import { Modal } from "../components/modal.jsx"; 13 - import { pds, setCID } from "../components/navbar.jsx"; 13 + import { pds } from "../components/navbar.jsx"; 14 14 import Tooltip from "../components/tooltip.jsx"; 15 15 import { setNotif } from "../layout.jsx"; 16 16 import { didDocCache, resolveLexiconAuthority, resolvePDS } from "../utils/api.js"; ··· 34 34 let rpc: Client; 35 35 36 36 const fetchRecord = async () => { 37 - setCID(undefined); 38 37 setValidRecord(undefined); 39 38 setValidSchema(undefined); 40 39 setLexiconUri(undefined); ··· 52 51 setNotice(res.data.error); 53 52 throw new Error(res.data.error); 54 53 } 55 - setCID(res.data.cid); 56 54 setExternalLink(checkUri(res.data.uri, res.data.value)); 57 55 resolveLexicon(params.collection as Nsid); 58 56 verify(res.data); ··· 198 196 label="Copy record" 199 197 icon="lucide--copy" 200 198 /> 199 + <Show when={record()?.cid}> 200 + {(cid) => <CopyMenu copyContent={cid()} label="Copy CID" icon="lucide--copy" />} 201 + </Show> 201 202 <Show when={lexiconUri()}> 202 203 <NavMenu 203 204 href={`/${lexiconUri()}`}