forked from pdsls.dev/pdsls
this repo has no description

move record on pds icon to toolbar

Changed files
+44 -45
src
components
utils
views
+33 -43
src/components/navbar.tsx
··· 186 186 </div> 187 187 </Show> 188 188 <Show when={props.params.rkey}> 189 - <div class="mt-1 flex items-center justify-between"> 190 - <div class="flex items-center gap-2"> 191 - <Tooltip text="Record"> 192 - <button onclick={() => addToClipboard(props.params.rkey)}> 193 - <div class="i-lucide-braces text-lg" /> 194 - </button> 195 - </Tooltip> 196 - <div class="flex gap-1"> 197 - <span>{props.params.rkey}</span> 198 - <Show when={validRecord()}> 199 - <Tooltip text="Valid record"> 200 - <div class="i-lucide-lock-keyhole" /> 201 - </Tooltip> 202 - </Show> 203 - <Show when={validRecord() === false}> 204 - <Tooltip text="Invalid record"> 205 - <div class="i-lucide-lock-keyhole-open text-red-500 dark:text-red-400" /> 206 - </Tooltip> 207 - </Show> 208 - <Show when={validRecord() === undefined}> 209 - <Tooltip text="Validating"> 210 - <div class="i-lucide-loader-circle animate-spin" /> 211 - </Tooltip> 212 - </Show> 213 - <Show when={validSchema()}> 214 - <Tooltip text="Valid schema"> 215 - <div class="i-lucide-file-check" /> 216 - </Tooltip> 217 - </Show> 218 - <Show when={validSchema() === false}> 219 - <Tooltip text="Invalid schema"> 220 - <div class="i-lucide-file-x text-red-500 dark:text-red-400" /> 221 - </Tooltip> 222 - </Show> 223 - </div> 224 - </div> 225 - <Tooltip text="Record on PDS"> 226 - <a 227 - href={`https://${pds()}/xrpc/com.atproto.repo.getRecord?repo=${props.params.repo}&collection=${props.params.collection}&rkey=${props.params.rkey}`} 228 - target="_blank" 229 - > 230 - <div class="i-lucide-external-link text-lg" /> 231 - </a> 189 + <div class="mt-1 flex items-center gap-2"> 190 + <Tooltip text="Record"> 191 + <button onclick={() => addToClipboard(props.params.rkey)}> 192 + <div class="i-lucide-braces text-lg" /> 193 + </button> 232 194 </Tooltip> 195 + <div class="flex gap-1"> 196 + <span>{props.params.rkey}</span> 197 + <Show when={validRecord()}> 198 + <Tooltip text="Valid record"> 199 + <div class="i-lucide-lock-keyhole" /> 200 + </Tooltip> 201 + </Show> 202 + <Show when={validRecord() === false}> 203 + <Tooltip text="Invalid record"> 204 + <div class="i-lucide-lock-keyhole-open text-red-500 dark:text-red-400" /> 205 + </Tooltip> 206 + </Show> 207 + <Show when={validRecord() === undefined}> 208 + <Tooltip text="Validating"> 209 + <div class="i-lucide-loader-circle animate-spin" /> 210 + </Tooltip> 211 + </Show> 212 + <Show when={validSchema()}> 213 + <Tooltip text="Valid schema"> 214 + <div class="i-lucide-file-check" /> 215 + </Tooltip> 216 + </Show> 217 + <Show when={validSchema() === false}> 218 + <Tooltip text="Invalid schema"> 219 + <div class="i-lucide-file-x text-red-500 dark:text-red-400" /> 220 + </Tooltip> 221 + </Show> 222 + </div> 233 223 </div> 234 224 </Show> 235 225 </div>
+1
src/utils/templates.ts
··· 30 30 "com.whtwnd.blog.entry": (uri) => ({ 31 31 label: "WhiteWind", 32 32 link: `https://whtwnd.com/${uri.repo}/${uri.rkey}`, 33 + icon: "i-lucide-wind", 33 34 }), 34 35 "com.shinolabs.pinksea.oekaki": (uri) => ({ 35 36 label: "PinkSea",
+10 -2
src/views/record.tsx
··· 6 6 import { Backlinks } from "../components/backlinks.jsx"; 7 7 import { JSONValue } from "../components/json.jsx"; 8 8 import { agent } from "../components/login.jsx"; 9 - import { setCID, setValidRecord, setValidSchema, validRecord } from "../components/navbar.jsx"; 9 + import { pds, setCID, setValidRecord, setValidSchema, validRecord } from "../components/navbar.jsx"; 10 10 11 11 import { didDocCache, getAllBacklinks, LinkData, resolvePDS } from "../utils/api.js"; 12 12 import { AtUri, uriTemplates } from "../utils/templates.js"; ··· 170 170 {(externalLink) => ( 171 171 <Tooltip text={`Open on ${externalLink().label}`}> 172 172 <a target="_blank" href={externalLink()?.link}> 173 - <div class={`${externalLink().icon ?? "i-lucide-external-link"} text-xl`} /> 173 + <div class={`${externalLink().icon ?? "i-lucide-app-window"} text-xl`} /> 174 174 </a> 175 175 </Tooltip> 176 176 )} 177 177 </Show> 178 + <Tooltip text="Record on PDS"> 179 + <a 180 + href={`https://${pds()}/xrpc/com.atproto.repo.getRecord?repo=${params.repo}&collection=${params.collection}&rkey=${params.rkey}`} 181 + target="_blank" 182 + > 183 + <div class="i-lucide-external-link text-xl" /> 184 + </a> 185 + </Tooltip> 178 186 <Show when={backlinks()}> 179 187 <Tooltip text={showBacklinks() ? "Show record" : "Show backlinks"}> 180 188 <button onclick={() => setShowBacklinks(!showBacklinks())}>